From 6d21d7370c29d4a2e8a164a9294efb74e071770e Mon Sep 17 00:00:00 2001 From: Paul Schneider Date: Mon, 11 Apr 2022 19:57:30 +0100 Subject: [PATCH] test --- test/isn.tests/UnitTest1.cs | 17 +++++++++-------- test/isn.tests/isn.tests.csproj | 12 +++++++++--- test/isn.tests/xunitTest1.cs | 13 +++++++++++++ test/isnd.tests/UnitTestWebHost.cs | 1 - test/isnd.tests/isnd.tests.csproj | 4 +++- 5 files changed, 34 insertions(+), 13 deletions(-) create mode 100644 test/isn.tests/xunitTest1.cs diff --git a/test/isn.tests/UnitTest1.cs b/test/isn.tests/UnitTest1.cs index 03720c8..1232930 100644 --- a/test/isn.tests/UnitTest1.cs +++ b/test/isn.tests/UnitTest1.cs @@ -4,11 +4,11 @@ using System.IO; using System.Xml; using System.Net.Http; -using NUnit.Framework; using System.Threading.Tasks; using Newtonsoft.Json; using isn.Abstract; using System.Linq; +using Xunit; namespace isn.tests { @@ -16,7 +16,7 @@ namespace isn.tests { private DataRow dataRow; - [Test] + [Fact] public void HAveADefaultDataProtector() { string pass = "a lame and big pass"; @@ -24,11 +24,12 @@ namespace isn.tests string protectedpass = _protector.Protect(pass); string unprotectedpass = _protector.UnProtect(protectedpass); Console.WriteLine(protectedpass); - Assert.AreEqual(pass, unprotectedpass); - Assert.Pass($"Good jod man! (decoding {protectedpass})"); + Assert.Equal(pass, unprotectedpass); + Assert.True(protectedpass!=null); + Assert.True(protectedpass.Length>0); } - [Test] + [Fact] public void Test() { System.Data.DataTable dataTable = new System.Data.DataTable(); @@ -42,7 +43,7 @@ dataTable.Rows.Add(dataRow); } - [Test] + [Fact] public async Task TestHttpClient() { string url = "http://localhost:88/index.json"; @@ -55,14 +56,14 @@ dataTable.Rows.Add(dataRow); Assert.NotNull(vm); Assert.NotNull(vm.Resources); } - [Test] + [Fact] public async Task TestPush() { Program.LoadConfig(); var report = await Program.PushPkgAsync(new string[] { "bin/Debug/isn.1.0.1.nupkg" }); } - [Test] + [Fact] public async Task GetServerResourcesUsingWebRequestAsyncTest() { var model = await SourceHelpers.GetServerResourcesUsingWebRequestAsync("Http://localhost:88/index.json"); diff --git a/test/isn.tests/isn.tests.csproj b/test/isn.tests/isn.tests.csproj index 87f70d9..0ae47b5 100644 --- a/test/isn.tests/isn.tests.csproj +++ b/test/isn.tests/isn.tests.csproj @@ -1,16 +1,22 @@ - net45 + net6 false - - + + + + + + + + diff --git a/test/isn.tests/xunitTest1.cs b/test/isn.tests/xunitTest1.cs new file mode 100644 index 0000000..62374b9 --- /dev/null +++ b/test/isn.tests/xunitTest1.cs @@ -0,0 +1,13 @@ +using Xunit; + +namespace isn.tests +{ + public class xunitTest1 + { + [Fact] + void Test1() + { + + } + } +} \ No newline at end of file diff --git a/test/isnd.tests/UnitTestWebHost.cs b/test/isnd.tests/UnitTestWebHost.cs index 9b92b3a..575153c 100644 --- a/test/isnd.tests/UnitTestWebHost.cs +++ b/test/isnd.tests/UnitTestWebHost.cs @@ -16,7 +16,6 @@ namespace isnd.host.tests const string testingUrl = "http://localhost:5000"; - [Fact] public void TestHaveTestDbContextAndMigrate() { string envVar = Environment.GetEnvironmentVariable("ASPNETCORE_ENVIRONMENT"); diff --git a/test/isnd.tests/isnd.tests.csproj b/test/isnd.tests/isnd.tests.csproj index 1bcc331..2f38a49 100644 --- a/test/isnd.tests/isnd.tests.csproj +++ b/test/isnd.tests/isnd.tests.csproj @@ -10,9 +10,11 @@ - + + +