示例#1
0
        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));
        }
示例#2
0
        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);
        }
示例#3
0
        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");
        }
示例#4
0
        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);
        }