public void DeleteConfirmed_只在是否已刪除欄位改成是() { //Assign var controller = new 客戶資料StubController(mockRepo); //Act int id = 0; var result = controller.DeleteConfirmed(id); //Assert Assert.AreEqual(4, customers.Count); Assert.AreEqual(true, customers[0].是否已刪除); }
public void DeletedConfirmed_RedirectToIndex() { //Assign var controller = new 客戶資料StubController(mockRepo); //Act int id = 0; var result = controller.DeleteConfirmed(id); //Assert Assert.IsInstanceOfType(result, typeof(RedirectToRouteResult)); var redirectResult = result as RedirectToRouteResult; Assert.AreEqual("Index", redirectResult.RouteValues["action"]); }