Inspired by dotnet show (#386)
* Changed the order of the projects, Web first to infer as startup. * Added encapsulated JSON serialization - and moved to System.Text.Json * Refactored a few minor updates out Co-authored-by: Eric Fleming <eric-fleming18@hotmail.com>
This commit is contained in:
@@ -25,7 +25,7 @@ namespace Microsoft.eShopWeb.FunctionalTests.Web.Controllers
|
||||
var response = await Client.GetAsync("/api/catalog/list");
|
||||
response.EnsureSuccessStatusCode();
|
||||
var stringResponse = await response.Content.ReadAsStringAsync();
|
||||
var model = JsonSerializer.Deserialize<CatalogIndexViewModel>(stringResponse, _jsonOptions);
|
||||
var model = stringResponse.FromJson<CatalogIndexViewModel>();
|
||||
|
||||
Assert.Equal(10, model.CatalogItems.Count());
|
||||
}
|
||||
@@ -36,7 +36,7 @@ namespace Microsoft.eShopWeb.FunctionalTests.Web.Controllers
|
||||
var response = await Client.GetAsync("/api/catalog/list?page=1");
|
||||
response.EnsureSuccessStatusCode();
|
||||
var stringResponse = await response.Content.ReadAsStringAsync();
|
||||
var model = JsonSerializer.Deserialize<CatalogIndexViewModel>(stringResponse, _jsonOptions);
|
||||
var model = stringResponse.FromJson<CatalogIndexViewModel>();
|
||||
|
||||
Assert.Equal(2, model.CatalogItems.Count());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user