Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
9a57c06
Add source generator for assertion methods and related tests
thomhurst Oct 12, 2025
c230bf6
Refactor assertion method generator to use core assertion classes and…
thomhurst Oct 12, 2025
91647e6
Add custom expectation message support to assertion attributes and ge…
thomhurst Oct 12, 2025
5c55681
Refactor assertions to use source-generated methods
thomhurst Oct 12, 2025
b244e9d
Migrate assertions to source-generated methods and remove legacy code
thomhurst Oct 12, 2025
241ca90
Refactor assertion infrastructure: update CheckAsync methods for asyn…
thomhurst Oct 12, 2025
0e3937d
Implement source-generated assertion extensions for CultureInfo, Enco…
thomhurst Oct 12, 2025
ea841cc
Add source-generated assertion extensions for Assembly and DateTime t…
thomhurst Oct 12, 2025
125ffd6
Implement source-generated assertion extensions for CancellationToken…
thomhurst Oct 12, 2025
456b7b2
Implement source-generated assertion extensions for Assembly and Canc…
thomhurst Oct 12, 2025
5779fba
Add source-generated assertion extensions for Guid, Stream, Task, Thr…
thomhurst Oct 12, 2025
7a17e68
Refactor source-generated assertion extensions for various types to u…
thomhurst Oct 12, 2025
270f6e9
Implement source-generated assertion extensions for CultureInfo, Date…
thomhurst Oct 12, 2025
5241c87
Add source-generated assertion extensions for DateTimeOffset, IPAddre…
thomhurst Oct 12, 2025
3a9f74d
Add source-generated assertion extensions for Array, Index, Range, an…
thomhurst Oct 12, 2025
349c2ad
Add source-generated assertion extensions for DateOnly, DirectoryInfo…
thomhurst Oct 12, 2025
f7488c2
Add source-generated assertion extensions for FileInfo, DirectoryInfo…
thomhurst Oct 12, 2025
06d4aaf
Refactor assertion extension classes to be partial and update project…
thomhurst Oct 12, 2025
f27edee
Add assertion tests for Guid, Lazy, StringBuilder, Task, and TimeSpan
thomhurst Oct 12, 2025
3efb326
Add EditorBrowsable attribute to assertion extension methods for bett…
thomhurst Oct 12, 2025
69507d2
Add EditorBrowsable attribute to source-generated assertion methods a…
thomhurst Oct 12, 2025
cceced9
Add assertion tests for Boolean, Char, DateTime, DateTimeOffset, and …
thomhurst Oct 12, 2025
0fb3319
Add assertion extensions for collection membership checks and update …
thomhurst Oct 12, 2025
6381ecb
Add comprehensive assertion tests for assembly, cancellation token, I…
thomhurst Oct 12, 2025
3e0f0eb
Add comprehensive assertion tests for various types and functionalities
thomhurst Oct 12, 2025
08ef10f
Add missing using directives for TUnit.Assertions.Extensions in vario…
thomhurst Oct 12, 2025
5c4547a
Add assertion generator tests for various types and conditions
thomhurst Oct 12, 2025
6af4911
Refactor assertion generator test classes to remove specific generato…
thomhurst Oct 12, 2025
5a8209c
Rename assertion classes and update method signatures to include type…
thomhurst Oct 12, 2025
4a4adae
Merge branch 'main' into feature/enhance-assertion-source-gen
thomhurst Oct 13, 2025
9621915
Add diagnostic messages to assertion extension generator tests
thomhurst Oct 13, 2025
5987f0a
Refactor assertion generator tests and remove diagnostic source gener…
thomhurst Oct 13, 2025
b11ffd4
Update assertion generator tests to expect zero generated files
thomhurst Oct 13, 2025
5d65398
Enhance assertion messages by adding ExpectationMessage attributes fo…
thomhurst Oct 13, 2025
d10d8f6
Update MethodAssertionGenerator to always generate extension methods …
thomhurst Oct 13, 2025
31b82a6
Refactor assertion namespaces and enhance task assertions
thomhurst Oct 13, 2025
27618ef
Refactor AsyncDelegateAssertion and TaskAssertion to avoid awaiting t…
thomhurst Oct 13, 2025
de89714
Refactor assertion tests to improve clarity and reliability by addres…
thomhurst Oct 13, 2025
8848571
Remove CleanGenerated target from SourceGenerationDebug.props to stre…
thomhurst Oct 13, 2025
3b068f6
Add RunOn attribute for Windows to relevant file and directory tests
thomhurst Oct 13, 2025
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
Prev Previous commit
Next Next commit
Refactor source-generated assertion extensions for various types to u…
…se nameof for member references
  • Loading branch information
thomhurst committed Oct 12, 2025
commit 7a17e685eaf5061c87e077b4ee486d98867c61b5
12 changes: 6 additions & 6 deletions TUnit.Assertions/Conditions/AssemblyAssertionExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@ namespace TUnit.Assertions.Conditions;
/// Source-generated assertions for Assembly type using [AssertionFrom<Assembly>] and [GenerateAssertion] attributes.
/// </summary>
#if !NETSTANDARD2_0
[AssertionFrom<Assembly>("IsCollectible", ExpectationMessage = "be collectible")]
[AssertionFrom<Assembly>("IsCollectible", CustomName = "IsNotCollectible", NegateLogic = true, ExpectationMessage = "be collectible")]
[AssertionFrom<Assembly>(nameof(Assembly.IsCollectible), ExpectationMessage = "be collectible")]
[AssertionFrom<Assembly>(nameof(Assembly.IsCollectible), CustomName = "IsNotCollectible", NegateLogic = true, ExpectationMessage = "be collectible")]
#endif

[AssertionFrom<Assembly>("IsDynamic", ExpectationMessage = "be dynamic")]
[AssertionFrom<Assembly>("IsDynamic", CustomName = "IsNotDynamic", NegateLogic = true, ExpectationMessage = "be dynamic")]
[AssertionFrom<Assembly>(nameof(Assembly.IsDynamic), ExpectationMessage = "be dynamic")]
[AssertionFrom<Assembly>(nameof(Assembly.IsDynamic), CustomName = "IsNotDynamic", NegateLogic = true, ExpectationMessage = "be dynamic")]

[AssertionFrom<Assembly>("IsFullyTrusted", ExpectationMessage = "be fully trusted")]
[AssertionFrom<Assembly>("IsFullyTrusted", CustomName = "IsNotFullyTrusted", NegateLogic = true, ExpectationMessage = "be fully trusted")]
[AssertionFrom<Assembly>(nameof(Assembly.IsFullyTrusted), ExpectationMessage = "be fully trusted")]
[AssertionFrom<Assembly>(nameof(Assembly.IsFullyTrusted), CustomName = "IsNotFullyTrusted", NegateLogic = true, ExpectationMessage = "be fully trusted")]
public static partial class AssemblyAssertionExtensions
{
[GenerateAssertion(ExpectationMessage = "to be signed")]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ namespace TUnit.Assertions.Conditions;
/// <summary>
/// Source-generated assertions for CancellationToken type using [AssertionFrom&lt;CancellationToken&gt;] and [GenerateAssertion] attributes.
/// </summary>
[AssertionFrom<CancellationToken>("CanBeCanceled", ExpectationMessage = "be cancellable")]
[AssertionFrom<CancellationToken>("CanBeCanceled", CustomName = "CannotBeCanceled", NegateLogic = true, ExpectationMessage = "be cancellable")]
[AssertionFrom<CancellationToken>(nameof(CancellationToken.CanBeCanceled), ExpectationMessage = "be cancellable")]
[AssertionFrom<CancellationToken>(nameof(CancellationToken.CanBeCanceled), CustomName = "CannotBeCanceled", NegateLogic = true, ExpectationMessage = "be cancellable")]

[AssertionFrom<CancellationToken>("IsCancellationRequested", ExpectationMessage = "have cancellation requested")]
[AssertionFrom<CancellationToken>("IsCancellationRequested", CustomName = "IsNotCancellationRequested", NegateLogic = true, ExpectationMessage = "have cancellation requested")]
[AssertionFrom<CancellationToken>(nameof(CancellationToken.IsCancellationRequested), ExpectationMessage = "have cancellation requested")]
[AssertionFrom<CancellationToken>(nameof(CancellationToken.IsCancellationRequested), CustomName = "IsNotCancellationRequested", NegateLogic = true, ExpectationMessage = "have cancellation requested")]
public static partial class CancellationTokenAssertionExtensions
{
[GenerateAssertion(ExpectationMessage = "to be CancellationToken.None")]
Expand Down
56 changes: 28 additions & 28 deletions TUnit.Assertions/Conditions/CharAssertionExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,47 +6,47 @@ namespace TUnit.Assertions.Conditions;
/// Source-generated assertions for char type using [AssertionFrom&lt;char&gt;] attributes.
/// Each assertion wraps a static method from the char class.
/// </summary>
[AssertionFrom<char>("IsLetter", ExpectationMessage = "be a letter")]
[AssertionFrom<char>("IsLetter", CustomName = "IsNotLetter", NegateLogic = true, ExpectationMessage = "be a letter")]
[AssertionFrom<char>(nameof(char.IsLetter), ExpectationMessage = "be a letter")]
[AssertionFrom<char>(nameof(char.IsLetter), CustomName = "IsNotLetter", NegateLogic = true, ExpectationMessage = "be a letter")]

[AssertionFrom<char>("IsDigit", ExpectationMessage = "be a digit")]
[AssertionFrom<char>("IsDigit", CustomName = "IsNotDigit", NegateLogic = true, ExpectationMessage = "be a digit")]
[AssertionFrom<char>(nameof(char.IsDigit), ExpectationMessage = "be a digit")]
[AssertionFrom<char>(nameof(char.IsDigit), CustomName = "IsNotDigit", NegateLogic = true, ExpectationMessage = "be a digit")]

[AssertionFrom<char>("IsWhiteSpace", ExpectationMessage = "be whitespace")]
[AssertionFrom<char>("IsWhiteSpace", CustomName = "IsNotWhiteSpace", NegateLogic = true, ExpectationMessage = "be whitespace")]
[AssertionFrom<char>(nameof(char.IsWhiteSpace), ExpectationMessage = "be whitespace")]
[AssertionFrom<char>(nameof(char.IsWhiteSpace), CustomName = "IsNotWhiteSpace", NegateLogic = true, ExpectationMessage = "be whitespace")]

[AssertionFrom<char>("IsUpper", ExpectationMessage = "be uppercase")]
[AssertionFrom<char>("IsUpper", CustomName = "IsNotUpper", NegateLogic = true, ExpectationMessage = "be uppercase")]
[AssertionFrom<char>(nameof(char.IsUpper), ExpectationMessage = "be uppercase")]
[AssertionFrom<char>(nameof(char.IsUpper), CustomName = "IsNotUpper", NegateLogic = true, ExpectationMessage = "be uppercase")]

[AssertionFrom<char>("IsLower", ExpectationMessage = "be lowercase")]
[AssertionFrom<char>("IsLower", CustomName = "IsNotLower", NegateLogic = true, ExpectationMessage = "be lowercase")]
[AssertionFrom<char>(nameof(char.IsLower), ExpectationMessage = "be lowercase")]
[AssertionFrom<char>(nameof(char.IsLower), CustomName = "IsNotLower", NegateLogic = true, ExpectationMessage = "be lowercase")]

[AssertionFrom<char>("IsControl", ExpectationMessage = "be a control character")]
[AssertionFrom<char>("IsControl", CustomName = "IsNotControl", NegateLogic = true, ExpectationMessage = "be a control character")]
[AssertionFrom<char>(nameof(char.IsControl), ExpectationMessage = "be a control character")]
[AssertionFrom<char>(nameof(char.IsControl), CustomName = "IsNotControl", NegateLogic = true, ExpectationMessage = "be a control character")]

[AssertionFrom<char>("IsPunctuation", ExpectationMessage = "be punctuation")]
[AssertionFrom<char>("IsPunctuation", CustomName = "IsNotPunctuation", NegateLogic = true, ExpectationMessage = "be punctuation")]
[AssertionFrom<char>(nameof(char.IsPunctuation), ExpectationMessage = "be punctuation")]
[AssertionFrom<char>(nameof(char.IsPunctuation), CustomName = "IsNotPunctuation", NegateLogic = true, ExpectationMessage = "be punctuation")]

[AssertionFrom<char>("IsSymbol", ExpectationMessage = "be a symbol")]
[AssertionFrom<char>("IsSymbol", CustomName = "IsNotSymbol", NegateLogic = true, ExpectationMessage = "be a symbol")]
[AssertionFrom<char>(nameof(char.IsSymbol), ExpectationMessage = "be a symbol")]
[AssertionFrom<char>(nameof(char.IsSymbol), CustomName = "IsNotSymbol", NegateLogic = true, ExpectationMessage = "be a symbol")]

[AssertionFrom<char>("IsNumber", ExpectationMessage = "be a number")]
[AssertionFrom<char>("IsNumber", CustomName = "IsNotNumber", NegateLogic = true, ExpectationMessage = "be a number")]
[AssertionFrom<char>(nameof(char.IsNumber), ExpectationMessage = "be a number")]
[AssertionFrom<char>(nameof(char.IsNumber), CustomName = "IsNotNumber", NegateLogic = true, ExpectationMessage = "be a number")]

[AssertionFrom<char>("IsSeparator", ExpectationMessage = "be a separator")]
[AssertionFrom<char>("IsSeparator", CustomName = "IsNotSeparator", NegateLogic = true, ExpectationMessage = "be a separator")]
[AssertionFrom<char>(nameof(char.IsSeparator), ExpectationMessage = "be a separator")]
[AssertionFrom<char>(nameof(char.IsSeparator), CustomName = "IsNotSeparator", NegateLogic = true, ExpectationMessage = "be a separator")]

[AssertionFrom<char>("IsSurrogate", ExpectationMessage = "be a surrogate")]
[AssertionFrom<char>("IsSurrogate", CustomName = "IsNotSurrogate", NegateLogic = true, ExpectationMessage = "be a surrogate")]
[AssertionFrom<char>(nameof(char.IsSurrogate), ExpectationMessage = "be a surrogate")]
[AssertionFrom<char>(nameof(char.IsSurrogate), CustomName = "IsNotSurrogate", NegateLogic = true, ExpectationMessage = "be a surrogate")]

[AssertionFrom<char>("IsHighSurrogate", ExpectationMessage = "be a high surrogate")]
[AssertionFrom<char>("IsHighSurrogate", CustomName = "IsNotHighSurrogate", NegateLogic = true, ExpectationMessage = "be a high surrogate")]
[AssertionFrom<char>(nameof(char.IsHighSurrogate), ExpectationMessage = "be a high surrogate")]
[AssertionFrom<char>(nameof(char.IsHighSurrogate), CustomName = "IsNotHighSurrogate", NegateLogic = true, ExpectationMessage = "be a high surrogate")]

[AssertionFrom<char>("IsLowSurrogate", ExpectationMessage = "be a low surrogate")]
[AssertionFrom<char>("IsLowSurrogate", CustomName = "IsNotLowSurrogate", NegateLogic = true, ExpectationMessage = "be a low surrogate")]
[AssertionFrom<char>(nameof(char.IsLowSurrogate), ExpectationMessage = "be a low surrogate")]
[AssertionFrom<char>(nameof(char.IsLowSurrogate), CustomName = "IsNotLowSurrogate", NegateLogic = true, ExpectationMessage = "be a low surrogate")]

[AssertionFrom<char>("IsLetterOrDigit", ExpectationMessage = "be a letter or digit")]
[AssertionFrom<char>("IsLetterOrDigit", CustomName = "IsNotLetterOrDigit", NegateLogic = true, ExpectationMessage = "be a letter or digit")]
[AssertionFrom<char>(nameof(char.IsLetterOrDigit), ExpectationMessage = "be a letter or digit")]
[AssertionFrom<char>(nameof(char.IsLetterOrDigit), CustomName = "IsNotLetterOrDigit", NegateLogic = true, ExpectationMessage = "be a letter or digit")]
public static partial class CharAssertionExtensions
{
}
6 changes: 3 additions & 3 deletions TUnit.Assertions/Conditions/CultureInfoPropertyAssertions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ namespace TUnit.Assertions.Conditions;
/// Source-generated assertions for CultureInfo type using [AssertionFrom&lt;CultureInfo&gt;] attributes.
/// Each assertion wraps a property from the CultureInfo class.
/// </summary>
[AssertionFrom<CultureInfo>("IsNeutralCulture", ExpectationMessage = "be a neutral culture")]
[AssertionFrom<CultureInfo>("IsNeutralCulture", CustomName = "IsNotNeutralCulture", NegateLogic = true, ExpectationMessage = "be a neutral culture")]
[AssertionFrom<CultureInfo>(nameof(CultureInfo.IsNeutralCulture), ExpectationMessage = "be a neutral culture")]
[AssertionFrom<CultureInfo>(nameof(CultureInfo.IsNeutralCulture), CustomName = "IsNotNeutralCulture", NegateLogic = true, ExpectationMessage = "be a neutral culture")]

[AssertionFrom<CultureInfo>("IsReadOnly", ExpectationMessage = "be read-only culture")]
[AssertionFrom<CultureInfo>(nameof(CultureInfo.IsReadOnly), ExpectationMessage = "be read-only culture")]
public static partial class CultureInfoPropertyAssertions
{
}
4 changes: 2 additions & 2 deletions TUnit.Assertions/Conditions/DateTimeMethodAssertions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ namespace TUnit.Assertions.Conditions;
/// Source-generated assertions for DateTime type using [AssertionFrom&lt;DateTime&gt;] attributes.
/// These wrap instance methods from the DateTime struct.
/// </summary>
[AssertionFrom<DateTime>("IsDaylightSavingTime", ExpectationMessage = "be during daylight saving time")]
[AssertionFrom<DateTime>("IsDaylightSavingTime", CustomName = "IsNotDaylightSavingTime", NegateLogic = true, ExpectationMessage = "be during daylight saving time")]
[AssertionFrom<DateTime>(nameof(DateTime.IsDaylightSavingTime), ExpectationMessage = "be during daylight saving time")]
[AssertionFrom<DateTime>(nameof(DateTime.IsDaylightSavingTime), CustomName = "IsNotDaylightSavingTime", NegateLogic = true, ExpectationMessage = "be during daylight saving time")]
public static partial class DateTimeMethodAssertions
{
}
4 changes: 2 additions & 2 deletions TUnit.Assertions/Conditions/EncodingPropertyAssertions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ namespace TUnit.Assertions.Conditions;
/// Source-generated assertions for Encoding type using [AssertionFrom&lt;Encoding&gt;] attributes.
/// Each assertion wraps a property from the Encoding class.
/// </summary>
[AssertionFrom<Encoding>("IsSingleByte", ExpectationMessage = "be single-byte encoding")]
[AssertionFrom<Encoding>("IsSingleByte", CustomName = "IsNotSingleByte", NegateLogic = true, ExpectationMessage = "be single-byte encoding")]
[AssertionFrom<Encoding>(nameof(Encoding.IsSingleByte), ExpectationMessage = "be single-byte encoding")]
[AssertionFrom<Encoding>(nameof(Encoding.IsSingleByte), CustomName = "IsNotSingleByte", NegateLogic = true, ExpectationMessage = "be single-byte encoding")]
public static partial class EncodingPropertyAssertions
{
}
16 changes: 8 additions & 8 deletions TUnit.Assertions/Conditions/StreamAssertionExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,17 @@ namespace TUnit.Assertions.Conditions;
/// Source-generated assertions for Stream type using [AssertionFrom&lt;Stream&gt;] attributes.
/// Each assertion wraps a property from the Stream class.
/// </summary>
[AssertionFrom<Stream>("CanRead", ExpectationMessage = "be readable")]
[AssertionFrom<Stream>("CanRead", CustomName = "CannotRead", NegateLogic = true, ExpectationMessage = "be readable")]
[AssertionFrom<Stream>(nameof(Stream.CanRead), ExpectationMessage = "be readable")]
[AssertionFrom<Stream>(nameof(Stream.CanRead), CustomName = "CannotRead", NegateLogic = true, ExpectationMessage = "be readable")]

[AssertionFrom<Stream>("CanWrite", ExpectationMessage = "be writable")]
[AssertionFrom<Stream>("CanWrite", CustomName = "CannotWrite", NegateLogic = true, ExpectationMessage = "be writable")]
[AssertionFrom<Stream>(nameof(Stream.CanWrite), ExpectationMessage = "be writable")]
[AssertionFrom<Stream>(nameof(Stream.CanWrite), CustomName = "CannotWrite", NegateLogic = true, ExpectationMessage = "be writable")]

[AssertionFrom<Stream>("CanSeek", ExpectationMessage = "be seekable")]
[AssertionFrom<Stream>("CanSeek", CustomName = "CannotSeek", NegateLogic = true, ExpectationMessage = "be seekable")]
[AssertionFrom<Stream>(nameof(Stream.CanSeek), ExpectationMessage = "be seekable")]
[AssertionFrom<Stream>(nameof(Stream.CanSeek), CustomName = "CannotSeek", NegateLogic = true, ExpectationMessage = "be seekable")]

[AssertionFrom<Stream>("CanTimeout", ExpectationMessage = "support timeout")]
[AssertionFrom<Stream>("CanTimeout", CustomName = "CannotTimeout", NegateLogic = true, ExpectationMessage = "support timeout")]
[AssertionFrom<Stream>(nameof(Stream.CanTimeout), ExpectationMessage = "support timeout")]
[AssertionFrom<Stream>(nameof(Stream.CanTimeout), CustomName = "CannotTimeout", NegateLogic = true, ExpectationMessage = "support timeout")]
public static partial class StreamAssertionExtensions
{
}
16 changes: 8 additions & 8 deletions TUnit.Assertions/Conditions/TaskAssertionExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,18 @@ namespace TUnit.Assertions.Conditions;
/// Source-generated assertions for Task type using [AssertionFrom&lt;Task&gt;] attributes.
/// Each assertion wraps a property from the Task class.
/// </summary>
[AssertionFrom<Task>("IsCompleted", ExpectationMessage = "be completed")]
[AssertionFrom<Task>("IsCompleted", CustomName = "IsNotCompleted", NegateLogic = true, ExpectationMessage = "be completed")]
[AssertionFrom<Task>(nameof(Task.IsCompleted), ExpectationMessage = "be completed")]
[AssertionFrom<Task>(nameof(Task.IsCompleted), CustomName = "IsNotCompleted", NegateLogic = true, ExpectationMessage = "be completed")]

[AssertionFrom<Task>("IsCanceled", ExpectationMessage = "be canceled")]
[AssertionFrom<Task>("IsCanceled", CustomName = "IsNotCanceled", NegateLogic = true, ExpectationMessage = "be canceled")]
[AssertionFrom<Task>(nameof(Task.IsCanceled), ExpectationMessage = "be canceled")]
[AssertionFrom<Task>(nameof(Task.IsCanceled), CustomName = "IsNotCanceled", NegateLogic = true, ExpectationMessage = "be canceled")]

[AssertionFrom<Task>("IsFaulted", ExpectationMessage = "be faulted")]
[AssertionFrom<Task>("IsFaulted", CustomName = "IsNotFaulted", NegateLogic = true, ExpectationMessage = "be faulted")]
[AssertionFrom<Task>(nameof(Task.IsFaulted), ExpectationMessage = "be faulted")]
[AssertionFrom<Task>(nameof(Task.IsFaulted), CustomName = "IsNotFaulted", NegateLogic = true, ExpectationMessage = "be faulted")]

#if NET6_0_OR_GREATER
[AssertionFrom<Task>("IsCompletedSuccessfully", ExpectationMessage = "be completed successfully")]
[AssertionFrom<Task>("IsCompletedSuccessfully", CustomName = "IsNotCompletedSuccessfully", NegateLogic = true, ExpectationMessage = "be completed successfully")]
[AssertionFrom<Task>(nameof(Task.IsCompletedSuccessfully), ExpectationMessage = "be completed successfully")]
[AssertionFrom<Task>(nameof(Task.IsCompletedSuccessfully), CustomName = "IsNotCompletedSuccessfully", NegateLogic = true, ExpectationMessage = "be completed successfully")]
#endif
public static partial class TaskAssertionExtensions
{
Expand Down
12 changes: 6 additions & 6 deletions TUnit.Assertions/Conditions/ThreadAssertionExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@ namespace TUnit.Assertions.Conditions;
/// Source-generated assertions for Thread type using [AssertionFrom&lt;Thread&gt;] attributes.
/// Each assertion wraps a property from the Thread class.
/// </summary>
[AssertionFrom<Thread>("IsAlive", ExpectationMessage = "be alive")]
[AssertionFrom<Thread>("IsAlive", CustomName = "IsNotAlive", NegateLogic = true, ExpectationMessage = "be alive")]
[AssertionFrom<Thread>(nameof(Thread.IsAlive), ExpectationMessage = "be alive")]
[AssertionFrom<Thread>(nameof(Thread.IsAlive), CustomName = "IsNotAlive", NegateLogic = true, ExpectationMessage = "be alive")]

[AssertionFrom<Thread>("IsBackground", ExpectationMessage = "be a background thread")]
[AssertionFrom<Thread>("IsBackground", CustomName = "IsNotBackground", NegateLogic = true, ExpectationMessage = "be a background thread")]
[AssertionFrom<Thread>(nameof(Thread.IsBackground), ExpectationMessage = "be a background thread")]
[AssertionFrom<Thread>(nameof(Thread.IsBackground), CustomName = "IsNotBackground", NegateLogic = true, ExpectationMessage = "be a background thread")]

[AssertionFrom<Thread>("IsThreadPoolThread", ExpectationMessage = "be a thread pool thread")]
[AssertionFrom<Thread>("IsThreadPoolThread", CustomName = "IsNotThreadPoolThread", NegateLogic = true, ExpectationMessage = "be a thread pool thread")]
[AssertionFrom<Thread>(nameof(Thread.IsThreadPoolThread), ExpectationMessage = "be a thread pool thread")]
[AssertionFrom<Thread>(nameof(Thread.IsThreadPoolThread), CustomName = "IsNotThreadPoolThread", NegateLogic = true, ExpectationMessage = "be a thread pool thread")]
public static partial class ThreadAssertionExtensions
{
}
Loading