Skip to content

Commit db534d1

Browse files
authored
Enable ConditonalFact and ConditionalTheory for XUnit v3 (#16190)
1 parent 82921f7 commit db534d1

File tree

6 files changed

+0
-41
lines changed

6 files changed

+0
-41
lines changed

src/Microsoft.DotNet.XUnitExtensions.Shared/Attributes/ConditionalFactAttribute.cs

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,6 @@
11
// Licensed to the .NET Foundation under one or more agreements.
22
// The .NET Foundation licenses this file to you under the MIT license.
33

4-
5-
// Not adding the support for xunit.v3.
6-
// Still keeping the logic inside compatible with xunit.v3 in case we decided to add it.
7-
// For cases that used to do [ConditionalFact] in xunit.v2, they can now call Assert.Skip instead of throwing SkipTestException
8-
// In this case, [Fact] will just work because Assert.Skip is natively supported in xunit.v3
9-
// TODO: Evaluate whether or not we want to still expose this attribute in xunit.v3 for usages of CalleeType and ConditionMemberNames?
10-
#if !USES_XUNIT_3
11-
124
using System;
135
using System.Diagnostics.CodeAnalysis;
146
using Microsoft.DotNet.XUnitExtensions;
@@ -43,4 +35,3 @@ public ConditionalFactAttribute(params string[] conditionMemberNames)
4335
}
4436
}
4537
}
46-
#endif

src/Microsoft.DotNet.XUnitExtensions.Shared/Attributes/ConditionalTheoryAttribute.cs

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,6 @@
11
// Licensed to the .NET Foundation under one or more agreements.
22
// The .NET Foundation licenses this file to you under the MIT license.
33

4-
// Not adding the support for xunit.v3.
5-
// Still keeping the logic inside compatible with xunit.v3 in case we decided to add it.
6-
// For cases that used to do [ConditionalTheory] in xunit.v2, they can now call Assert.Skip instead of throwing SkipTestException
7-
// In this case, [Fact] will just work because Assert.Skip is natively supported in xunit.v3
8-
// TODO: Evaluate whether or not we want to still expose this attribute in xunit.v3 for usages of CalleeType and ConditionMemberNames?
9-
#if !USES_XUNIT_3
10-
114
using System;
125
using System.Diagnostics.CodeAnalysis;
136
using Microsoft.DotNet.XUnitExtensions;
@@ -42,4 +35,3 @@ public ConditionalTheoryAttribute(params string[] conditionMemberNames)
4235
}
4336
}
4437
}
45-
#endif

src/Microsoft.DotNet.XUnitExtensions.Shared/Discoverers/ConditionalFactDiscoverer.cs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,6 @@
11
// Licensed to the .NET Foundation under one or more agreements.
22
// The .NET Foundation licenses this file to you under the MIT license.
33

4-
// Not adding the support for xunit.v3.
5-
// This is used by ConditionalFact and ConditionalTheory which we no longer support in xunit.v3.
6-
// Still keeping the logic inside supporting xunit.v3 in case we decided to add it.
7-
#if !USES_XUNIT_3
8-
94
using System;
105
using System.Collections.Generic;
116
using System.Linq;
@@ -60,4 +55,3 @@ protected override IXunitTestCase CreateTestCase(ITestFrameworkDiscoveryOptions
6055
}
6156
}
6257
}
63-
#endif

src/Microsoft.DotNet.XUnitExtensions.Shared/Discoverers/ConditionalTheoryDiscoverer.cs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,6 @@
11
// Licensed to the .NET Foundation under one or more agreements.
22
// The .NET Foundation licenses this file to you under the MIT license.
33

4-
// Not adding the support for xunit.v3.
5-
// This is used by ConditionalFact and ConditionalTheory which we no longer support in xunit.v3.
6-
// Still keeping the logic inside supporting xunit.v3 in case we decided to add it.
7-
#if !USES_XUNIT_3
8-
94
using System;
105
using System.Collections.Generic;
116
using System.Linq;
@@ -138,4 +133,3 @@ protected override IEnumerable<IXunitTestCase> CreateTestCasesForDataRow(ITestFr
138133
}
139134
}
140135
}
141-
#endif

src/Microsoft.DotNet.XUnitExtensions.Shared/SkippedFactTestCase.cs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,6 @@
11
// Licensed to the .NET Foundation under one or more agreements.
22
// The .NET Foundation licenses this file to you under the MIT license.
33

4-
// Not adding the support for xunit.v3.
5-
// This is used by ConditionalFact and ConditionalTheory which we no longer support in xunit.v3.
6-
// Still keeping the logic inside supporting xunit.v3 in case we decided to add it.
7-
#if !USES_XUNIT_3
8-
94
using System;
105
using System.Collections.Generic;
116
using System.Linq;
@@ -79,4 +74,3 @@ public override async Task<RunSummary> RunAsync(IMessageSink diagnosticMessageSi
7974
}
8075
}
8176
}
82-
#endif

src/Microsoft.DotNet.XUnitExtensions.Shared/SkippedTestMessageBus.cs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,6 @@
11
// Licensed to the .NET Foundation under one or more agreements.
22
// The .NET Foundation licenses this file to you under the MIT license.
33

4-
// Not adding the support for xunit.v3.
5-
// This is used by ConditionalFact and ConditionalTheory which we no longer support in xunit.v3.
6-
// Still keeping the logic inside supporting xunit.v3 in case we decided to add it.
7-
#if !USES_XUNIT_3
8-
94
using System;
105
using System.Linq;
116
#if !USES_XUNIT_3
@@ -72,4 +67,3 @@ public bool QueueMessage(IMessageSinkMessage message)
7267
}
7368
}
7469
}
75-
#endif

0 commit comments

Comments
 (0)