public void DetailsValidId() { //act Region actual = (Region)((ViewResult)controller.Details(349)).Model; //assert Assert.AreEqual(regions[1], actual); }
public void DetailsNoId() { //act var result = (ViewResult)controller.Details(null); //assert Assert.AreEqual("Error", result.ViewName); }
public async Task RegionReturnsDetails() { //Arrage Region regionTest = new Region() { RegionID = 100, RegionDescription = "Acasa" }; //Act var result = await _regionsControllerTest.Details(regionTest.RegionID); //Assert Assert.IsNotNull(result); var region = db.Regions.Where(r => r.RegionDescription == regionTest.RegionDescription); db.Regions.RemoveRange(region); db.SaveChanges(); }
public void DetailsValidId() { Region actual = (Region)((ViewResult)controller.Details(null)).Model; Assert.AreEqual(regions[2], actual); }