Пример #1
0
 public void EditIdParam()
 {
     var repMock = new Mock<IFakultetRepository<Ispits>>();
     Ispits ispit = new Ispits() { IspitID = 1, Naziv = "Ispit1" };
     repMock.Setup(x => x.GetEntityById(ispit.IspitID)).Returns(ispit);
     controller = new IspitsController(repMock.Object);
     var result = controller.Edit(ispit.IspitID) as ViewResult;
     Ispits i = result.ViewData.Model as Ispits;
     repMock.VerifyAll();
     Assert.AreEqual("Edit", result.ViewName);
     Assert.AreEqual(1, i.IspitID);
 }
Пример #2
0
 public void EditIspitsParam()
 {
     var repMock = new Mock<IFakultetRepository<Ispits>>();
     Ispits ispit = new Ispits() { IspitID = 1, Naziv = "Ispit1" };
     repMock.Setup(x => x.UpdateEntity(ispit));
     controller = new IspitsController(repMock.Object);
     var result = controller.Edit(ispit) as RedirectToRouteResult;
     repMock.VerifyAll();
     Assert.AreEqual("Index", result.RouteValues["Action"]);
 }