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
28 changes: 28 additions & 0 deletions TUnit.Mocks.SourceGenerator.Tests/MockGeneratorTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -415,4 +415,32 @@ void M()

return VerifyGeneratorOutput(source);
}

[Test]
public Task Interface_With_Nullable_Reference_Type_Parameters()
{
var source = """
using TUnit.Mocks;
using System.Threading.Tasks;

public interface IFoo
{
void Bar(object? baz);
string? GetValue(string? key, int count);
void Process(string nonNull, string? nullable, object? obj);
Task<string?> GetAsync(string? key);
string? NullableProp { get; set; }
}

public class TestUsage
{
void M()
{
var mock = Mock.Of<IFoo>();
}
}
""";

return VerifyGeneratorOutput(source);
}
}
Loading
Loading