public void DetailsTest4() { //test details metode; dal je result type view result // Arrange var controller = new ZaposlenisController(); // Act ActionResult result = controller.Details(1); // Assert Assert.IsInstanceOfType(result, typeof(ViewResult)); }
public void DetailsTest3() { //test details metode ; dal je za uneti id u metodi Details naziv View-a jednak "" // Arrange var controller = new ZaposlenisController(); // Act var result = controller.Details(1) as ViewResult; // Assert Assert.AreEqual("", result.ViewName); }
public void DetailsTest() { //test details metode ;za redirect test,dal dobro gadja rutu tj dal salje na Index // Arrange var controller = new ZaposlenisController(); // Act var result = (RedirectToRouteResult)controller.Details(null); // Assert Assert.AreEqual(result.RouteValues["action"], "Index"); }
public void DetailsTest2() { //test details metode ; dal je za uneti id u metodi Details vrednost property-ja sektor jednaka "IT" // Arrange var controller = new ZaposlenisController(); // Act var result = controller.Details(1) as ViewResult; var zaposleni = (Zaposleni)result.ViewData.Model; // Assert Assert.AreEqual("IT", zaposleni.Sektor); }