From 9f3a998281bbde42978dcc69b8de2825f595d04e Mon Sep 17 00:00:00 2001 From: Terje Sandstrom Date: Sat, 23 Dec 2017 16:28:37 +0100 Subject: [PATCH] Updated tests and project to work #4 --- .../NUnit3CoreTestDemo/NUnit3CoreTestDemo.csproj | 14 ++++---------- src/csharp/GenericTests.cs | 8 +++++--- src/csharp/ParameterizedTests.cs | 9 +++++---- src/csharp/SimpleTests.cs | 2 -- 4 files changed, 14 insertions(+), 19 deletions(-) diff --git a/solutions/vs2017/NUnit3CoreTestDemo/NUnit3CoreTestDemo.csproj b/solutions/vs2017/NUnit3CoreTestDemo/NUnit3CoreTestDemo.csproj index c1c06ea..42c3bcb 100644 --- a/solutions/vs2017/NUnit3CoreTestDemo/NUnit3CoreTestDemo.csproj +++ b/solutions/vs2017/NUnit3CoreTestDemo/NUnit3CoreTestDemo.csproj @@ -3,14 +3,7 @@ netcoreapp1.1 false - - - - bin\Debug\ - - - - bin\Release\ + latest @@ -27,8 +20,9 @@ - - + + + diff --git a/src/csharp/GenericTests.cs b/src/csharp/GenericTests.cs index 61355c5..ca69341 100644 --- a/src/csharp/GenericTests.cs +++ b/src/csharp/GenericTests.cs @@ -27,14 +27,16 @@ namespace NUnitTestDemo [SetUp] public void CreateList() { - this.list = new TList(); + list = new TList(); } [Test] public void CanAddToList() { - list.Add(1); list.Add(2); list.Add(3); - Assert.AreEqual(3, list.Count); + list.Add(1); + list.Add(2); + list.Add(3); + Assert.That(list.Count,Is.EqualTo(3)); } } } diff --git a/src/csharp/ParameterizedTests.cs b/src/csharp/ParameterizedTests.cs index 04d11ed..ef1ea30 100644 --- a/src/csharp/ParameterizedTests.cs +++ b/src/csharp/ParameterizedTests.cs @@ -1,9 +1,5 @@ using System; -using System.Collections.Generic; -using System.Text; using NUnit.Framework; -using NUnit.Framework.Internal; -using NUnit.Framework.Interfaces; #if NETCOREAPP1_1 namespace NUnitCoreTestDemo @@ -123,6 +119,11 @@ namespace NUnitTestDemo { } + [TestCase(TestName = "{c.m}")] + public void TestCaseWithRandomParameterWithFixedNaming([Random(1)] int x) + { + } + #if false // Test for issue #144 [MyTestCase] public void TestCaseWithBadTestBuilder(string baz) diff --git a/src/csharp/SimpleTests.cs b/src/csharp/SimpleTests.cs index 6880649..7071718 100644 --- a/src/csharp/SimpleTests.cs +++ b/src/csharp/SimpleTests.cs @@ -1,6 +1,4 @@ using System; -using System.Collections.Generic; -using System.Text; using NUnit.Framework; #if NETCOREAPP1_1