WIP reg page

This commit is contained in:
2022-09-23 20:34:51 +01:00
parent 14206ac477
commit fececb327e
36 changed files with 264 additions and 211 deletions

View File

@ -27,53 +27,53 @@ namespace isn.tests
string unprotectedpass = _protector.UnProtect(protectedpass);
Console.WriteLine(protectedpass);
Assert.Equal(pass, unprotectedpass);
Assert.True(protectedpass!=null);
Assert.True(protectedpass.Length>0);
Assert.True(protectedpass != null);
Assert.True(protectedpass.Length > 0);
}
[Fact]
public void Test()
{
System.Data.DataTable dataTable = new System.Data.DataTable();
dataTable.Columns.Add(new DataColumn("x"));
dataTable.Columns.Add(new DataColumn("y"));
dataRow = dataTable.NewRow();
dataRow[0]= 1;
dataRow[1]= 2;
dataTable.Columns.Add(new DataColumn("x"));
dataTable.Columns.Add(new DataColumn("y"));
dataRow = dataTable.NewRow();
dataRow[0] = 1;
dataRow[1] = 2;
dataTable.Rows.Add(dataRow);
dataTable.Rows.Add(dataRow);
}
[Fact]
public async Task TestHttpClient()
{
string url = "http://isn.pschneider.fr/" + ApiConfig.Base;
string url = "http://isn.pschneider.fr/" + ApiConfig.IndexDotJson;
HttpClient client = new HttpClient();
// var json = await client.GetStringAsync(new System.Uri(url));
var response = await client.GetAsync(url);
var json = await response.Content.ReadAsStringAsync();
var vm = JsonConvert.DeserializeObject<ApiIndexViewModel>(json);
Console.WriteLine( JsonConvert.SerializeObject(vm));
Console.WriteLine(JsonConvert.SerializeObject(vm));
Assert.NotNull(vm);
Assert.NotNull(vm.Resources);
}
[Fact]
[Fact]
public void TestPush()
{
Program.LoadConfig();
var report = Program.PushPkg(new string[] { "/home/paul/Nupkgs/Yavsc.Abstract.1.0.8."
Program.LoadConfig();
var report = Program.PushPkg(new string[] { "/home/paul/Nupkgs/Yavsc.Abstract.1.0.8."
+ Constants.PaquetFileEstension });
}
[Fact]
[Fact]
public async Task GetServerResourcesUsingHttpClientAsyncTest()
{
var model = SourceHelpers.GetServerResources("Http://isn.pschneider.fr/index.json");
Console.WriteLine(JsonConvert.SerializeObject(model));
Assert.NotNull(model.Resources);
var pub = model.Resources.FirstOrDefault((r) => r.Type.StartsWith("PackagePublish/"));
Assert.True(pub!=null);
Assert.True(pub != null);
}
}