xunit web server collection

This commit is contained in:
Paul Schneider 2023-01-29 13:04:50 +00:00
commit 3695c17429
38 changed files with 1033 additions and 140 deletions

View file

@ -16,10 +16,9 @@ namespace isn.tests
{
public class Tests
{
private DataRow dataRow;
[Fact]
public void HAveADefaultDataProtector()
public void HaveADefaultDataProtector()
{
string pass = "a lame and big pass";
isn.IDataProtector _protector = new isn.DefaultDataProtector();
@ -31,24 +30,10 @@ namespace isn.tests
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.Rows.Add(dataRow);
}
[Fact]
public async Task TestHttpClient()
{
string url = "http://isn.pschneider.fr/" + ApiConfig.IndexDotJson;
string url = "https://isn.pschneider.fr/" + ApiConfig.IndexDotJson;
HttpClient client = new HttpClient();
// var json = await client.GetStringAsync(new System.Uri(url));
var response = await client.GetAsync(url);
@ -67,9 +52,9 @@ namespace isn.tests
}
[Fact]
public async Task GetServerResourcesUsingHttpClientAsyncTest()
public void GetServerResourcesUsingHttpClientAsyncTest()
{
var model = SourceHelpers.GetServerResources("Http://isn.pschneider.fr/index.json");
var model = SourceHelpers.GetServerResources("Https://isn.pschneider.fr/index.json");
Console.WriteLine(JsonConvert.SerializeObject(model));
Assert.NotNull(model.Resources);
var pub = model.Resources.FirstOrDefault((r) => r.Type.StartsWith("PackagePublish/"));