Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -1629,7 +1629,7 @@ global::TUnit.Core.ParameterMetadataFactory.Create(typeof(object), "arg", new gl
{
new global::TUnit.Core.TestAttribute(),
new global::TUnit.TestProject.Attributes.EngineTest(global::TUnit.TestProject.Attributes.ExpectedResult.Pass),
new global::TUnit.Core.ArgumentsAttribute<string>(null)
new global::TUnit.Core.ArgumentsAttribute<string>(null!)
};
}
public static readonly global::TUnit.Core.TestEntry<global::TUnit.TestProject.Bugs._7118.NullTypedClassRow<string>>[] Entries_0 = new global::TUnit.Core.TestEntry<global::TUnit.TestProject.Bugs._7118.NullTypedClassRow<string>>[]
Expand All @@ -1646,7 +1646,7 @@ global::TUnit.Core.ParameterMetadataFactory.Create(typeof(object), "arg", new gl
},
classDataSources: new global::TUnit.Core.IDataSourceAttribute[]
{
new global::TUnit.Core.ArgumentsAttribute<string>(null),
new global::TUnit.Core.ArgumentsAttribute<string>(null!),
},
methodMetadata: __mm_0,
createInstance: __CreateInstance_0,
Expand Down Expand Up @@ -1713,7 +1713,7 @@ global::TUnit.Core.ParameterMetadataFactory.Create(typeof(object), "arg", new gl
{
new global::TUnit.Core.TestAttribute(),
new global::TUnit.TestProject.Attributes.EngineTest(global::TUnit.TestProject.Attributes.ExpectedResult.Pass),
new global::TUnit.Core.ArgumentsAttribute<string[]>(null)
new global::TUnit.Core.ArgumentsAttribute<string[]>(null!)
};
}
public static readonly global::TUnit.Core.TestEntry<global::TUnit.TestProject.Bugs._7118.ArrayParameterNullTypedClassRow<string>>[] Entries_0 = new global::TUnit.Core.TestEntry<global::TUnit.TestProject.Bugs._7118.ArrayParameterNullTypedClassRow<string>>[]
Expand All @@ -1730,7 +1730,7 @@ global::TUnit.Core.ParameterMetadataFactory.Create(typeof(object), "arg", new gl
},
classDataSources: new global::TUnit.Core.IDataSourceAttribute[]
{
new global::TUnit.Core.ArgumentsAttribute<string[]>(null),
new global::TUnit.Core.ArgumentsAttribute<string[]>(null!),
},
methodMetadata: __mm_0,
createInstance: __CreateInstance_0,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public async Task Mapped_Assertion_Failure_Preserves_InnerException()
AssertionException? caught = null;
try
{
await Assert.That(value).Satisfies(v => v.Length, length => length.IsEqualTo(99));
await Assert.That(value).Satisfies(v => v!.Length, length => length.IsEqualTo(99));
}
catch (AssertionException ex)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,6 @@ private static async Task MeasureAsync()
/// </summary>
internal sealed class SerialExecutor : GenericAbstractExecutor, ITestRegisteredEventReceiver
{
public int Order => 0;

public ValueTask OnTestRegistered(TestRegisteredContext context)
{
context.SetParallelLimiter(new SerialLimit());
Expand Down Expand Up @@ -129,8 +127,6 @@ internal sealed class EqualByTypeExecutor : GenericAbstractExecutor, ITestRegist
{
public bool IsRegistered { get; private set; }

public int Order => 0;

public ValueTask OnTestRegistered(TestRegisteredContext context)
{
IsRegistered = true;
Expand Down
8 changes: 4 additions & 4 deletions tests/TUnit.TestProject/Bugs/_7118/MixedTypeRowsTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -222,10 +222,10 @@ public async Task Test(T? arg)
}
}

// A class row [Arguments<string>(null)] declares string, so its null value makes a string instantiation, and
// A class row [Arguments<string>(null!)] declares string, so its null value makes a string instantiation, and
// the method row "a" runs on it: Test("a") on <string> with a null constructor value.
[EngineTest(ExpectedResult.Pass)]
[Arguments<string>(null)]
[Arguments<string>(null!)]
public class NullTypedClassRow<T>(T? value)
{
[Test]
Expand All @@ -238,10 +238,10 @@ public async Task Test(T arg)
}
}

// A class row [Arguments<string[]>(null)] binds its null value to the constructor's T[] parameter, so it infers T
// A class row [Arguments<string[]>(null!)] binds its null value to the constructor's T[] parameter, so it infers T
// as string, not string[], and the method row "a" runs on <string> with a null constructor value.
[EngineTest(ExpectedResult.Pass)]
[Arguments<string[]>(null)]
[Arguments<string[]>(null!)]
public class ArrayParameterNullTypedClassRow<T>(T[]? values)
{
[Test]
Expand Down
2 changes: 1 addition & 1 deletion tests/TUnit.TestProject/TestCountVerificationTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ public class TestCountVerificationTests(int value)
[Test]
public async Task SimpleTest()
{
await Task.CompletedTask;
await Assert.That(value).IsIn(1, 2, 10);
}

public class TestDataSource
Expand Down
2 changes: 2 additions & 0 deletions tests/TUnit.TestProject/TimeoutCancellationTokenTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,8 @@ public class CancellationTokenTriggeredTests(int value)
[Test]
public async Task CancellationTokenIsTriggered(CancellationToken cancellationToken)
{
await Assert.That(value).IsEqualTo(1);

var fired = false;
cancellationToken.Register(() => fired = true);

Expand Down
2 changes: 1 addition & 1 deletion tests/TUnit.TestProject/TransactionTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ namespace TUnit.TestProject;
[EngineTest(ExpectedResult.Pass)]
public class TransactionTest
{
private TransactionScope _scope;
private TransactionScope _scope = null!; // Initialized by the Before(Test) hook.

[Before(Test)]
public void Setup(TestContext context)
Expand Down
Loading