Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Port to Xunit #52

Closed
wants to merge 58 commits into from
Closed
Show file tree
Hide file tree
Changes from 2 commits
Commits
Show all changes
58 commits
Select commit Hold shift + click to select a range
a38abc3
Add xunit and Xunit.SkippableFact, replace [Test] with [SkippableFact]
Arkatufus Aug 21, 2020
14ecb1d
Replace IgnoreException with SkipException
Arkatufus Aug 21, 2020
e2c1ae3
Replace `Assert.Ignore` with `TckAssert.Skip` and `Assert.Fail` with …
Arkatufus Aug 21, 2020
6e56e66
replace Assert functions to the equivalent version in Xunit
Arkatufus Aug 21, 2020
56e9f3e
Add `Assert.Fail` and `Assert.Ignore` support
Arkatufus Aug 21, 2020
08db990
Remove TextFixtureAttribute
Arkatufus Aug 21, 2020
ce6f42e
Add ITestOutputHelper support
Arkatufus Aug 21, 2020
72e080b
Fix OptionalActivePublisherTest, it was eating all exceptions
Arkatufus Aug 21, 2020
d484a57
Turn on netcoreapp3.1 testing
Arkatufus Aug 21, 2020
1c4a538
Update build script to dotnet 3.1.105 LTS, add RunTestsDotNet build args
Arkatufus Aug 21, 2020
feb6247
Merge branch 'master' into Update_to_Xunit
Arkatufus May 17, 2021
d9b05e3
Update framework targets and package versions
Arkatufus May 17, 2021
3e2e02f
Add xunit and Xunit.SkippableFact, replace [Test] with [SkippableFact]
Arkatufus Aug 21, 2020
2c21b07
Replace IgnoreException with SkipException
Arkatufus Aug 21, 2020
4c56cd0
Replace `Assert.Ignore` with `TckAssert.Skip` and `Assert.Fail` with …
Arkatufus Aug 21, 2020
9fa653e
replace Assert functions to the equivalent version in Xunit
Arkatufus Aug 21, 2020
a6cb650
Add `Assert.Fail` and `Assert.Ignore` support
Arkatufus Aug 21, 2020
5b50b7b
Remove TextFixtureAttribute
Arkatufus Aug 21, 2020
ab53717
Add ITestOutputHelper support
Arkatufus Aug 21, 2020
49fd87e
Fix OptionalActivePublisherTest, it was eating all exceptions
Arkatufus Aug 21, 2020
044a695
Turn on netcoreapp3.1 testing
Arkatufus Aug 21, 2020
3a7436a
Update build script to dotnet 3.1.105 LTS, add RunTestsDotNet build args
Arkatufus Aug 21, 2020
3a85e83
Added me to relicensing file
marcpiechura Aug 19, 2020
de965e7
Signed relicensing doc
cconstantin Aug 20, 2020
a5466f9
Update Relicensing.txt
alexvaluyskiy Sep 9, 2020
1093ff0
Port NUnit to XUnit, update target frameworks to netstandard2.0 and n…
viktorklang Oct 29, 2020
635332b
Update framework targets and package versions
Arkatufus May 17, 2021
b566ecf
Merge branch 'Update_to_Xunit' of github.com:Arkatufus/reactive-strea…
Arkatufus May 17, 2021
94e485b
Added copyright
alexvaluyskiy Mar 14, 2017
abd4803
Fix missing Cancel() in tests that don't consume the entire source (#32)
akarnokd Mar 27, 2017
c0225ec
Update CopyrightWaivers.txt
akarnokd Mar 18, 2017
83730c7
Skip §2.13 for value types (#34)
Apr 1, 2017
d45bfa5
fail if timeout is reached
marcpiechura Apr 1, 2017
2b34b05
1.0.0 stable release (#28)
Apr 5, 2017
36ebf21
bump version
Apr 7, 2017
5d687fc
Add the 'I' prefix to component names
akarnokd Apr 5, 2017
d8964c0
Update AsyncSubscriber.cs
Megasware128 Jun 29, 2017
dac6326
Added xml documentation (#42)
alexvaluyskiy Aug 8, 2017
a819a0e
Preparing for relicensing to MIT-0
viktorklang Aug 12, 2020
785397d
Update Relicensing.txt
akarnokd Aug 12, 2020
b68530b
Add xunit and Xunit.SkippableFact, replace [Test] with [SkippableFact]
Arkatufus Aug 21, 2020
fbf7f35
Replace IgnoreException with SkipException
Arkatufus Aug 21, 2020
39d5b7b
Replace `Assert.Ignore` with `TckAssert.Skip` and `Assert.Fail` with …
Arkatufus Aug 21, 2020
463a68c
replace Assert functions to the equivalent version in Xunit
Arkatufus Aug 21, 2020
380a841
Add `Assert.Fail` and `Assert.Ignore` support
Arkatufus Aug 21, 2020
f43349c
Remove TextFixtureAttribute
Arkatufus Aug 21, 2020
7fd7136
Add ITestOutputHelper support
Arkatufus Aug 21, 2020
5ff3cba
Fix OptionalActivePublisherTest, it was eating all exceptions
Arkatufus Aug 21, 2020
bc73d6b
Turn on netcoreapp3.1 testing
Arkatufus Aug 21, 2020
79008d1
Update build script to dotnet 3.1.105 LTS, add RunTestsDotNet build args
Arkatufus Aug 21, 2020
07b7f26
Added me to relicensing file
marcpiechura Aug 19, 2020
b9fb096
Signed relicensing doc
cconstantin Aug 20, 2020
5ec79c5
Update Relicensing.txt
alexvaluyskiy Sep 9, 2020
2ff6255
Port NUnit to XUnit, update target frameworks to netstandard2.0 and n…
viktorklang Oct 29, 2020
68ef99a
Update framework targets and package versions
Arkatufus May 17, 2021
b45555b
Add xunit and Xunit.SkippableFact, replace [Test] with [SkippableFact]
Arkatufus Aug 21, 2020
9c99de1
Merge branch 'Update_to_Xunit' of github.com:Arkatufus/reactive-strea…
Arkatufus May 17, 2021
16412fd
Update target frameworks
Arkatufus May 17, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -207,4 +207,5 @@ UpgradeLog*.htm
.dotnet/

# Tools
tools/
tools/
src/.vs/
3 changes: 1 addition & 2 deletions src/api/Reactive.Streams/Reactive.Streams.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,10 @@
<Copyright>CC0 1.0 Universal</Copyright>
<VersionPrefix>1.0.3</VersionPrefix>
<Authors>Reactive Streams</Authors>
<TargetFrameworks>netstandard1.0;net45</TargetFrameworks>
<TargetFrameworks>netstandard2.0;net452</TargetFrameworks>
<PackageTags>reactive;stream</PackageTags>
<PackageProjectUrl>https://github.com/reactive-streams/reactive-streams-dotnet</PackageProjectUrl>
<PackageLicenseUrl>http://creativecommons.org/publicdomain/zero/1.0/</PackageLicenseUrl>
<NetStandardImplicitPackageVersion>1.6.0</NetStandardImplicitPackageVersion>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
</PropertyGroup>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using System;
using System.Threading;
using NUnit.Framework;
using Xunit;
using Xunit.Abstractions;
using Reactive.Streams.TCK;
using Reactive.Streams.TCK.Support;

Expand All @@ -22,7 +23,7 @@ private sealed class Suscriber : AsyncSubscriber<int?>
protected override bool WhenNext(int? element) => true;
}

[Test]
[SkippableFact]
public void TestAccumulation()
{
var i = new AtomicCounterLong(0);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
using System;
using System.Collections;
using System.Collections.Generic;
using NUnit.Framework;
using Xunit;
using Xunit.Abstractions;
using Reactive.Streams.TCK;

namespace Reactive.Streams.Example.Unicast.Tests
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<AssemblyName>Reactive.Streams.Example.Unicast.Tests</AssemblyName>
<TargetFrameworks>net45</TargetFrameworks>
<TargetFrameworks>net461</TargetFrameworks>
<RuntimeIdentifier>win7-x64</RuntimeIdentifier>
</PropertyGroup>

Expand All @@ -12,9 +12,10 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.0.0" />
<PackageReference Include="NUnit" Version="3.7.1" />
<PackageReference Include="NUnit3TestAdapter" Version="3.8.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.7.0" />
<PackageReference Include="xunit" Version="2.4.1" />
<PackageReference Include="xunit.runner.utility" Version="2.4.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.1" />
</ItemGroup>

<PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using System;
using NUnit.Framework;
using Xunit;
using Xunit.Abstractions;
using Reactive.Streams.TCK;

namespace Reactive.Streams.Example.Unicast.Tests
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using System;
using NUnit.Framework;
using Xunit;
using Xunit.Abstractions;
using Reactive.Streams.TCK;

namespace Reactive.Streams.Example.Unicast.Tests
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
using System;
using System.Collections;
using System.Collections.Generic;
using NUnit.Framework;
using Xunit;
using Xunit.Abstractions;
using Reactive.Streams.TCK;

namespace Reactive.Streams.Example.Unicast.Tests
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,14 @@

<PropertyGroup>
<AssemblyName>Reactive.Streams.Example.Unicast</AssemblyName>
<TargetFrameworks>netstandard1.4;net45</TargetFrameworks>
<TargetFrameworks>netstandard2.0;net452</TargetFrameworks>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
</PropertyGroup>

<ItemGroup>
<ProjectReference Include="..\..\api\Reactive.Streams\Reactive.Streams.csproj" />
</ItemGroup>

<ItemGroup Condition=" '$(TargetFramework)' == 'netstandard1.4' ">
<PackageReference Include="System.Diagnostics.TraceSource" Version="4.3.0" />
</ItemGroup>

<PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
<DefineConstants>$(DefineConstants);RELEASE</DefineConstants>
</PropertyGroup>
Expand Down
10 changes: 5 additions & 5 deletions src/tck/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ Here is an example test method signature:

```C#
// Verifies rule: https://github.com/reactive-streams/reactive-streams-jvm#1.1
[Test]
[SkippableFact]
public void Required_spec101_subscriptionRequestMustResultInTheCorrectNumberOfProducedElements()
{
// ...
Expand All @@ -54,7 +54,7 @@ public void Required_spec101_subscriptionRequestMustResultInTheCorrectNumberOfPr
#### Test types explained:

```C#
[Test]
[SkippableFact]
public void Required_spec101_subscriptionRequestMustResultInTheCorrectNumberOfProducedElements()
```

Expand All @@ -63,15 +63,15 @@ The `Required_` means that this test case is a hard requirement, it covers a *MU


```C#
[Test]
[SkippableFact]
public void Optional_spec104_mustSignalOnErrorWhenFails()
```

<a name="type-optional"></a>
The `Optional_` means that this test case is an optional requirement, it covers a *MAY* or *SHOULD* Rule of the Specification.

```C#
[Test]
[SkippableFact]
public void Stochastic_spec103_mustSignalOnMethodsSequentially()
```

Expand All @@ -80,7 +80,7 @@ The `Stochastic_` means that the Rule is impossible or infeasible to determinist
usually this means that this test case can yield false positives ("be green") even if for some case, the given implementation may violate the tested behaviour.

```C#
[Test]
[SkippableFact]
public void Untested_spec106_mustConsiderSubscriptionCancelledAfterOnErrorOrOnCompleteHasBeenCalled()
```

Expand Down
4 changes: 2 additions & 2 deletions src/tck/Reactive.Streams.TCK.Tests/EmptyLazyPublisherTest.cs
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
using System.Linq;
using NUnit.Framework;
using Xunit;
using Xunit.Abstractions;
using Reactive.Streams.Example.Unicast;

namespace Reactive.Streams.TCK.Tests
{
[TestFixture]
public class EmptyLazyPublisherTest : PublisherVerification<int>
{
public EmptyLazyPublisherTest() : base(new TestEnvironment())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
using System.Linq;
using System.Reflection;
using System.Text;
using NUnit.Framework;
using Xunit;
using Xunit.Abstractions;

namespace Reactive.Streams.TCK.Tests
{
Expand All @@ -16,7 +17,7 @@ namespace Reactive.Streams.TCK.Tests
/// </summary>
public class IdentityProcessorVerificationDelegationTest
{
[Test]
[SkippableFact]
public void ShouldIncludeAllTestsFromPublisherVerification()
{
var processeroTests = GetTestNames(typeof(IdentityProcessorVerification<>)).ToList();
Expand All @@ -25,7 +26,7 @@ public void ShouldIncludeAllTestsFromPublisherVerification()
typeof(PublisherVerification<>), publisherTests);
}

[Test]
[SkippableFact]
public void ShouldIncludeAllTestsFromSubscriberVerification()
{
var processeroTests = GetTestNames(typeof(IdentityProcessorVerification<>)).ToList();
Expand All @@ -42,7 +43,7 @@ private static void AssertSuiteDelegatedAllTests(Type delegatingFrom, IList<stri
var message = new StringBuilder();
message.AppendLine($"Test '{targetTest}' in '{targetClass}' has not been properly delegated to in aggregate '{delegatingFrom}'!");
message.AppendLine($"You must delegate to this test from {delegatingFrom}, like this:");
message.AppendLine("[Test]");
message.AppendLine("[SkippableFact]");
message.AppendLine($"public void {targetTest} () => delegate{targetClass.Name}.{targetTest}();");

Assert.True(TestsInclude(allTests, targetTest), message.ToString());
Expand All @@ -54,7 +55,9 @@ private static bool TestsInclude(IList<string> processorTests, string targetTest

private static IEnumerable<string> GetTestNames(Type type)
=> type.GetMethods()
.Where(m => m.GetCustomAttribute<TestAttribute>() != null)
.Where(m =>
m.GetCustomAttribute<FactAttribute>() != null ||
m.GetCustomAttribute<SkippableFactAttribute>() != null)
.Select(m => m.Name);
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using System;
using NUnit.Framework;
using Xunit;
using Xunit.Abstractions;
using Reactive.Streams.TCK.Tests.Support;

namespace Reactive.Streams.TCK.Tests
Expand All @@ -11,7 +12,7 @@ public class IdentityProcessorVerificationTest : TCKVerificationSupport
private static readonly long DefaultNoSignalsTimeoutMilliseconds =
TestEnvironment.EnvironmentDefaultNoSignalsTimeoutMilliseconds();

[Test]
[SkippableFact]
public void Required_spec104_mustCallOnErrorOnAllItsSubscribersIfItEncountersANonRecoverableError_shouldBeIgnored()
{
RequireTestSkip(() =>
Expand Down Expand Up @@ -98,7 +99,7 @@ public Spec104WaitingVerification(TestEnvironment environment, long publisherRef
public override IPublisher<int> CreateFailedPublisher() => null;
}

[Test]
[SkippableFact]
public void Required_spec104_mustCallOnErrorOnAllItsSubscribersIfItEncountersANonRecoverableError_shouldFailWhileWaitingForOnError()
{
RequireTestFailure(() =>
Expand Down
Loading