From eb594d5bae53ad629a6fdc3057a04598ce2515f3 Mon Sep 17 00:00:00 2001 From: Kevin Bost Date: Sat, 6 Jan 2024 22:56:36 -0800 Subject: [PATCH] Enabled centralized package management Updated NuGets Fixed issue with NUnit test generator. --- Directory.Packages.props | 21 +++++++++++++++++++ ...q.AutoMock.Generator.Example.MSTest.csproj | 8 +++---- ...oq.AutoMock.Generator.Example.NUnit.csproj | 8 +++---- ...oq.AutoMock.Generator.Example.xUnit.csproj | 8 +++---- Generators/Generators.csproj | 2 +- Moq.AutoMock.Tests/Moq.AutoMock.Tests.csproj | 8 +++---- Moq.AutoMock.sln | 1 + Moq.AutoMock/Moq.AutoMock.csproj | 10 ++++++--- .../Moq.AutoMocker.TestGenerator.Tests.csproj | 10 ++++----- .../Moq.AutoMocker.TestGenerator.csproj | 2 +- .../UnitTestSourceGenerator.cs | 2 +- 11 files changed, 53 insertions(+), 27 deletions(-) create mode 100644 Directory.Packages.props diff --git a/Directory.Packages.props b/Directory.Packages.props new file mode 100644 index 00000000..550ccaf9 --- /dev/null +++ b/Directory.Packages.props @@ -0,0 +1,21 @@ + + + true + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/GeneratorTests/Moq.AutoMock.Generator.Example.MSTest/Moq.AutoMock.Generator.Example.MSTest.csproj b/GeneratorTests/Moq.AutoMock.Generator.Example.MSTest/Moq.AutoMock.Generator.Example.MSTest.csproj index 0e3b9c61..35923b5e 100644 --- a/GeneratorTests/Moq.AutoMock.Generator.Example.MSTest/Moq.AutoMock.Generator.Example.MSTest.csproj +++ b/GeneratorTests/Moq.AutoMock.Generator.Example.MSTest/Moq.AutoMock.Generator.Example.MSTest.csproj @@ -9,10 +9,10 @@ - - - - + + + + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/GeneratorTests/Moq.AutoMock.Generator.Example.NUnit/Moq.AutoMock.Generator.Example.NUnit.csproj b/GeneratorTests/Moq.AutoMock.Generator.Example.NUnit/Moq.AutoMock.Generator.Example.NUnit.csproj index 319cff80..d263f547 100644 --- a/GeneratorTests/Moq.AutoMock.Generator.Example.NUnit/Moq.AutoMock.Generator.Example.NUnit.csproj +++ b/GeneratorTests/Moq.AutoMock.Generator.Example.NUnit/Moq.AutoMock.Generator.Example.NUnit.csproj @@ -9,10 +9,10 @@ - - - - + + + + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/GeneratorTests/Moq.AutoMock.Generator.Example.xUnit/Moq.AutoMock.Generator.Example.xUnit.csproj b/GeneratorTests/Moq.AutoMock.Generator.Example.xUnit/Moq.AutoMock.Generator.Example.xUnit.csproj index 0a1d6307..4c2b4fbc 100644 --- a/GeneratorTests/Moq.AutoMock.Generator.Example.xUnit/Moq.AutoMock.Generator.Example.xUnit.csproj +++ b/GeneratorTests/Moq.AutoMock.Generator.Example.xUnit/Moq.AutoMock.Generator.Example.xUnit.csproj @@ -9,13 +9,13 @@ - - - + + + runtime; build; native; contentfiles; analyzers; buildtransitive all - + runtime; build; native; contentfiles; analyzers; buildtransitive all diff --git a/Generators/Generators.csproj b/Generators/Generators.csproj index 6f3ef82e..591183eb 100644 --- a/Generators/Generators.csproj +++ b/Generators/Generators.csproj @@ -8,7 +8,7 @@ - + diff --git a/Moq.AutoMock.Tests/Moq.AutoMock.Tests.csproj b/Moq.AutoMock.Tests/Moq.AutoMock.Tests.csproj index 590f95e2..24097082 100644 --- a/Moq.AutoMock.Tests/Moq.AutoMock.Tests.csproj +++ b/Moq.AutoMock.Tests/Moq.AutoMock.Tests.csproj @@ -27,10 +27,10 @@ - - - - + + + + \ No newline at end of file diff --git a/Moq.AutoMock.sln b/Moq.AutoMock.sln index 05040c19..a452e396 100644 --- a/Moq.AutoMock.sln +++ b/Moq.AutoMock.sln @@ -12,6 +12,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution .editorconfig = .editorconfig Directory.Build.props = Directory.Build.props Directory.Build.targets = Directory.Build.targets + Directory.Packages.props = Directory.Packages.props global.json = global.json LICENSE.md = LICENSE.md README.md = README.md diff --git a/Moq.AutoMock/Moq.AutoMock.csproj b/Moq.AutoMock/Moq.AutoMock.csproj index 1a723178..c3c7fd27 100644 --- a/Moq.AutoMock/Moq.AutoMock.csproj +++ b/Moq.AutoMock/Moq.AutoMock.csproj @@ -29,11 +29,11 @@ - + all - - + + Analyzer false @@ -47,6 +47,10 @@ + + + + ResXFileCodeGenerator diff --git a/Moq.AutoMocker.TestGenerator.Tests/Moq.AutoMocker.TestGenerator.Tests.csproj b/Moq.AutoMocker.TestGenerator.Tests/Moq.AutoMocker.TestGenerator.Tests.csproj index 5cf7a302..fb8ad5a4 100644 --- a/Moq.AutoMocker.TestGenerator.Tests/Moq.AutoMocker.TestGenerator.Tests.csproj +++ b/Moq.AutoMocker.TestGenerator.Tests/Moq.AutoMocker.TestGenerator.Tests.csproj @@ -9,11 +9,11 @@ - - - - - + + + + + diff --git a/Moq.AutoMocker.TestGenerator/Moq.AutoMocker.TestGenerator.csproj b/Moq.AutoMocker.TestGenerator/Moq.AutoMocker.TestGenerator.csproj index 1fe3572b..fe81003d 100644 --- a/Moq.AutoMocker.TestGenerator/Moq.AutoMocker.TestGenerator.csproj +++ b/Moq.AutoMocker.TestGenerator/Moq.AutoMocker.TestGenerator.csproj @@ -12,6 +12,6 @@ - + diff --git a/Moq.AutoMocker.TestGenerator/UnitTestSourceGenerator.cs b/Moq.AutoMocker.TestGenerator/UnitTestSourceGenerator.cs index 3a07bee8..7b2a9abf 100644 --- a/Moq.AutoMocker.TestGenerator/UnitTestSourceGenerator.cs +++ b/Moq.AutoMocker.TestGenerator/UnitTestSourceGenerator.cs @@ -96,7 +96,7 @@ public void Execute(GeneratorExecutionContext context) break; case TargetTestingFramework.NUnit: builder.AppendLine($" System.ArgumentNullException ex = global::NUnit.Framework.Assert.Throws(() => {constructorInvocation});"); - builder.AppendLine($" global::NUnit.Framework.Assert.AreEqual(\"{test.NullParameterName}\", ex.ParamName);"); + builder.AppendLine($" global::NUnit.Framework.Assert.That(\"{test.NullParameterName}\" == ex.ParamName);"); break; }