Skip to content

Commit

Permalink
revert global.json update
Browse files Browse the repository at this point in the history
  • Loading branch information
BenjaminMichaelis committed Jan 26, 2024
1 parent e81f912 commit 05be524
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 1 deletion.
45 changes: 45 additions & 0 deletions Moq.AutoMocker.TestGenerator.Tests/TestGeneratorTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -326,6 +326,51 @@ partial class ControllerTests
}.RunAsync();
}

[TestMethod]
public async Task Generation_ParameterWithNullableStringAndDefaultValue_DoesNotGenerateTest()
{
var code = @"
#nullable enable
using Moq.AutoMock;
using System.Threading;
namespace TestNamespace;
[ConstructorTests(typeof(Controller), TestGenerationBehavior.IgnoreNullableParameters)]
public partial class ControllerTests
{
}
public class Controller
{
public Controller(string? name = null) { }
}
";
string expected = @"namespace TestNamespace
{
partial class ControllerTests
{
partial void AutoMockerTestSetup(Moq.AutoMock.AutoMocker mocker, string testName);
}
}
";

await new VerifyCS.Test
{
TestCode = code,
TestState =
{
GeneratedSources =
{
GetSourceFile(expected, "ControllerTests.g.cs")
}
}

}.RunAsync();
}

[TestMethod]
public async Task Generation_ParameterWithNullableValueType_DoesNotGenerateTest()
{
Expand Down
2 changes: 1 addition & 1 deletion global.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"sdk": {
"version": "8.0.100",
"version": "6.0.400",
"rollForward": "latestMinor"
}
}

0 comments on commit 05be524

Please sign in to comment.