-
Notifications
You must be signed in to change notification settings - Fork 28
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
Closed
Port to Xunit #52
Changes from 1 commit
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 14ecb1d
Replace IgnoreException with SkipException
Arkatufus e2c1ae3
Replace `Assert.Ignore` with `TckAssert.Skip` and `Assert.Fail` with …
Arkatufus 6e56e66
replace Assert functions to the equivalent version in Xunit
Arkatufus 56e9f3e
Add `Assert.Fail` and `Assert.Ignore` support
Arkatufus 08db990
Remove TextFixtureAttribute
Arkatufus ce6f42e
Add ITestOutputHelper support
Arkatufus 72e080b
Fix OptionalActivePublisherTest, it was eating all exceptions
Arkatufus d484a57
Turn on netcoreapp3.1 testing
Arkatufus 1c4a538
Update build script to dotnet 3.1.105 LTS, add RunTestsDotNet build args
Arkatufus feb6247
Merge branch 'master' into Update_to_Xunit
Arkatufus d9b05e3
Update framework targets and package versions
Arkatufus 3e2e02f
Add xunit and Xunit.SkippableFact, replace [Test] with [SkippableFact]
Arkatufus 2c21b07
Replace IgnoreException with SkipException
Arkatufus 4c56cd0
Replace `Assert.Ignore` with `TckAssert.Skip` and `Assert.Fail` with …
Arkatufus 9fa653e
replace Assert functions to the equivalent version in Xunit
Arkatufus a6cb650
Add `Assert.Fail` and `Assert.Ignore` support
Arkatufus 5b50b7b
Remove TextFixtureAttribute
Arkatufus ab53717
Add ITestOutputHelper support
Arkatufus 49fd87e
Fix OptionalActivePublisherTest, it was eating all exceptions
Arkatufus 044a695
Turn on netcoreapp3.1 testing
Arkatufus 3a7436a
Update build script to dotnet 3.1.105 LTS, add RunTestsDotNet build args
Arkatufus 3a85e83
Added me to relicensing file
marcpiechura de965e7
Signed relicensing doc
cconstantin a5466f9
Update Relicensing.txt
alexvaluyskiy 1093ff0
Port NUnit to XUnit, update target frameworks to netstandard2.0 and n…
viktorklang 635332b
Update framework targets and package versions
Arkatufus b566ecf
Merge branch 'Update_to_Xunit' of github.com:Arkatufus/reactive-strea…
Arkatufus 94e485b
Added copyright
alexvaluyskiy abd4803
Fix missing Cancel() in tests that don't consume the entire source (#32)
akarnokd c0225ec
Update CopyrightWaivers.txt
akarnokd 83730c7
Skip §2.13 for value types (#34)
d45bfa5
fail if timeout is reached
marcpiechura 2b34b05
1.0.0 stable release (#28)
36ebf21
bump version
5d687fc
Add the 'I' prefix to component names
akarnokd d8964c0
Update AsyncSubscriber.cs
Megasware128 dac6326
Added xml documentation (#42)
alexvaluyskiy a819a0e
Preparing for relicensing to MIT-0
viktorklang 785397d
Update Relicensing.txt
akarnokd b68530b
Add xunit and Xunit.SkippableFact, replace [Test] with [SkippableFact]
Arkatufus fbf7f35
Replace IgnoreException with SkipException
Arkatufus 39d5b7b
Replace `Assert.Ignore` with `TckAssert.Skip` and `Assert.Fail` with …
Arkatufus 463a68c
replace Assert functions to the equivalent version in Xunit
Arkatufus 380a841
Add `Assert.Fail` and `Assert.Ignore` support
Arkatufus f43349c
Remove TextFixtureAttribute
Arkatufus 7fd7136
Add ITestOutputHelper support
Arkatufus 5ff3cba
Fix OptionalActivePublisherTest, it was eating all exceptions
Arkatufus bc73d6b
Turn on netcoreapp3.1 testing
Arkatufus 79008d1
Update build script to dotnet 3.1.105 LTS, add RunTestsDotNet build args
Arkatufus 07b7f26
Added me to relicensing file
marcpiechura b9fb096
Signed relicensing doc
cconstantin 5ec79c5
Update Relicensing.txt
alexvaluyskiy 2ff6255
Port NUnit to XUnit, update target frameworks to netstandard2.0 and n…
viktorklang 68ef99a
Update framework targets and package versions
Arkatufus b45555b
Add xunit and Xunit.SkippableFact, replace [Test] with [SkippableFact]
Arkatufus 9c99de1
Merge branch 'Update_to_Xunit' of github.com:Arkatufus/reactive-strea…
Arkatufus 16412fd
Update target frameworks
Arkatufus File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
47 changes: 47 additions & 0 deletions
47
src/tck/Reactive.Streams.TCK/Support/AssertionException.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
|
||
namespace Reactive.Streams.TCK.Support | ||
{ | ||
/// <summary> | ||
/// Thrown when an assertion failed. | ||
/// </summary> | ||
[Serializable] | ||
public class AssertionException : Exception | ||
{ | ||
/// <param name="message">The error message that explains | ||
/// the reason for the exception</param> | ||
public AssertionException(string message) : base(message) | ||
{ } | ||
|
||
/// <param name="message">The error message that explains | ||
/// the reason for the exception</param> | ||
/// <param name="inner">The exception that caused the | ||
/// current exception</param> | ||
public AssertionException(string message, Exception inner) : | ||
base(message, inner) | ||
{ } | ||
|
||
#if SERIALIZATION | ||
/// <summary> | ||
/// Serialization Constructor | ||
/// </summary> | ||
protected AssertionException(System.Runtime.Serialization.SerializationInfo info, | ||
System.Runtime.Serialization.StreamingContext context) : base(info,context) | ||
{} | ||
#endif | ||
|
||
/* | ||
/// <summary> | ||
/// Gets the ResultState provided by this exception | ||
/// </summary> | ||
public override ResultState ResultState | ||
{ | ||
get { return ResultState.Failure; } | ||
} | ||
*/ | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,95 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
using Xunit; | ||
|
||
namespace Reactive.Streams.TCK.Support | ||
{ | ||
public static class TckAssert | ||
{ | ||
#region Fail | ||
|
||
/// <summary> | ||
/// Throws an <see cref="AssertionException"/> with the message and arguments | ||
/// that are passed in. This is used by the other Assert functions. | ||
/// </summary> | ||
/// <param name="message">The message to initialize the <see cref="AssertionException"/> with.</param> | ||
/// <param name="args">Arguments to be used in formatting the message</param> | ||
public static void Fail(string message, params object[] args) | ||
{ | ||
if (message == null) message = string.Empty; | ||
else if (args != null && args.Length > 0) | ||
message = string.Format(message, args); | ||
|
||
throw new AssertionException(message); | ||
//ReportFailure(message); | ||
} | ||
|
||
/// <summary> | ||
/// Throws an <see cref="AssertionException"/> with the message that is | ||
/// passed in. This is used by the other Assert functions. | ||
/// </summary> | ||
/// <param name="message">The message to initialize the <see cref="AssertionException"/> with.</param> | ||
public static void Fail(string message) | ||
{ | ||
Fail(message, null); | ||
} | ||
|
||
/// <summary> | ||
/// Throws an <see cref="AssertionException"/>. | ||
/// This is used by the other Assert functions. | ||
/// </summary> | ||
public static void Fail() | ||
{ | ||
Fail(string.Empty, null); | ||
} | ||
|
||
#endregion | ||
|
||
#region Skip | ||
|
||
/// <summary> | ||
/// Throws an <see cref="SkipException"/> with the message and arguments | ||
/// that are passed in. This causes the test to be reported as ignored. | ||
/// </summary> | ||
/// <param name="message">The message to initialize the <see cref="AssertionException"/> with.</param> | ||
/// <param name="args">Arguments to be used in formatting the message</param> | ||
public static void Skip(string message, params object[] args) | ||
{ | ||
if (message == null) message = string.Empty; | ||
else if (args != null && args.Length > 0) | ||
message = string.Format(message, args); | ||
|
||
/* | ||
// If we are in a multiple assert block, this is an error | ||
if (TestExecutionContext.CurrentContext.MultipleAssertLevel > 0) | ||
throw new Exception("Assert.Ignore may not be used in a multiple assertion block."); | ||
*/ | ||
|
||
throw new SkipException(message); | ||
} | ||
|
||
/// <summary> | ||
/// Throws an <see cref="SkipException"/> with the message that is | ||
/// passed in. This causes the test to be reported as ignored. | ||
/// </summary> | ||
/// <param name="message">The message to initialize the <see cref="AssertionException"/> with.</param> | ||
public static void Skip(string message) | ||
{ | ||
Skip(message, null); | ||
} | ||
|
||
/// <summary> | ||
/// Throws an <see cref="SkipException"/>. | ||
/// This causes the test to be reported as ignored. | ||
/// </summary> | ||
public static void Skip() | ||
{ | ||
Skip(string.Empty, null); | ||
} | ||
|
||
#endregion | ||
} | ||
} |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This static class is added to add
Assert.Ignore
(renamed to Skip) andAssert.Fail
convenience static methods