[Test]
public void GetAllItems_ItemsFromApiAndDatabase_ShouldBeEquivalent()
{
var itemsFromApi = ApiService.GetAllAccounts();
var itemsFromDatabase = DbSteps.GetAllAccounts().ToList();
using (new AssertionScope())
{
RestResponseAssertions.StatusCodeShouldBe(itemsFromApi.Result, HttpStatusCode.OK);
RestResponseAssertions.ItemsShouldBeEquivalent(itemsFromApi.Result.Data.Items, itemsFromDatabase);
}
}
[Test]
public void GetAllItems_BadRequest()
{
var itemsFromApi = ApiService.GetAllAccounts();
using (new AssertionScope())
{
RestResponseAssertions.StatusCodeShouldBe(itemsFromApi.Result, HttpStatusCode.BadRequest);
RestResponseAssertions.ErrorModelShouldContainCode(itemsFromApi.Result.Data, "400");
}
}