From 968580ba4482779e07711e92262452b44becddbc Mon Sep 17 00:00:00 2001 From: Ivan Pehsterski Date: Wed, 2 Sep 2026 20:53:47 +0300 Subject: [PATCH] Add NUnit testing samples --- .../CalculatorTests.cs | 12 +++++++++ .../NUnitMTP.csproj | 26 +++++++++++++++++++ test/nunit/vstest/CalculatorTests.cs | 12 +++++++++ test/nunit/vstest/NUnitVSTest.csproj | 23 ++++++++++++++++ 4 files changed, 73 insertions(+) create mode 100644 test/nunit/microsoft-testing-platform/CalculatorTests.cs create mode 100644 test/nunit/microsoft-testing-platform/NUnitMTP.csproj create mode 100644 test/nunit/vstest/CalculatorTests.cs create mode 100644 test/nunit/vstest/NUnitVSTest.csproj diff --git a/test/nunit/microsoft-testing-platform/CalculatorTests.cs b/test/nunit/microsoft-testing-platform/CalculatorTests.cs new file mode 100644 index 00000000000..a46f5c83836 --- /dev/null +++ b/test/nunit/microsoft-testing-platform/CalculatorTests.cs @@ -0,0 +1,12 @@ +namespace NUnitMTP; + +public sealed class CalculatorTests +{ + [Test] + public void Add_TwoNumbers_ReturnsExpectedSum() + { + int result = 2 + 3; + + Assert.That(result, Is.EqualTo(5)); + } +} \ No newline at end of file diff --git a/test/nunit/microsoft-testing-platform/NUnitMTP.csproj b/test/nunit/microsoft-testing-platform/NUnitMTP.csproj new file mode 100644 index 00000000000..9a81df67d8a --- /dev/null +++ b/test/nunit/microsoft-testing-platform/NUnitMTP.csproj @@ -0,0 +1,26 @@ + + + + net9.0 + latest + enable + enable + false + + true + true + Exe + + + + + + + + + + + + + + \ No newline at end of file diff --git a/test/nunit/vstest/CalculatorTests.cs b/test/nunit/vstest/CalculatorTests.cs new file mode 100644 index 00000000000..eedbb660ef4 --- /dev/null +++ b/test/nunit/vstest/CalculatorTests.cs @@ -0,0 +1,12 @@ +namespace NUnitVSTest; + +public sealed class CalculatorTests +{ + [Test] + public void Add_TwoNumbers_ReturnsExpectedSum() + { + int result = 2 + 3; + + Assert.That(result, Is.EqualTo(5)); + } +} diff --git a/test/nunit/vstest/NUnitVSTest.csproj b/test/nunit/vstest/NUnitVSTest.csproj new file mode 100644 index 00000000000..2055aa08805 --- /dev/null +++ b/test/nunit/vstest/NUnitVSTest.csproj @@ -0,0 +1,23 @@ + + + + net9.0 + latest + enable + enable + false + + + + + + + + + + + + + + +