public void TestListBrandAsync() { ContextSeeder.Seed(); var bo = new BrandBusinessObject(); var resList = bo.ListAsync().Result; Assert.IsTrue(resList.Success && resList.Result.Count == 1); }
public void TestCreateSameNameBrandAsync() { ContextSeeder.Seed(); var bo = new BrandBusinessObject(); var item = bo.ListAsync().Result.Result.FirstOrDefault(); var reg = new Brand(item.Name); var resCreate = bo.CreateAsync(reg).Result; Assert.IsTrue(!resCreate.Result); }
public void TestDeleteBrandAsync() { ContextSeeder.Seed(); var bo = new BrandBusinessObject(); var resList = bo.ListAsync().Result; var resDelete = bo.DeleteAsync(resList.Result.First().Id).Result; resList = bo.ListNotDeletedAsync().Result; Assert.IsTrue(resDelete.Success && resList.Success && resList.Result.Count == 0); }
public void TestUpdateBrandAsync() { ContextSeeder.Seed(); var bo = new BrandBusinessObject(); var resList = bo.ListAsync().Result; var item = resList.Result.FirstOrDefault(); item.Name = "It's just wine"; var resUpdate = bo.UpdateAsync(item).Result; resList = bo.ListNotDeletedAsync().Result; Assert.IsTrue(resList.Success && resUpdate.Success && resList.Result.First().Name == "It's just wine"); }