This commit is contained in:
2022-04-11 19:57:30 +01:00
parent ee07affbbd
commit 6d21d7370c
5 changed files with 34 additions and 13 deletions

View File

@ -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");