Exemplo n.º 1
0
 public void EditIdParam()
 {
     var repMock = new Mock<IFakultetRepository<Students>>();
     Students student = new Students() { BI = "10011", Ime = "Pera", Prezime = "Peric", Adresa = "Ulica1", Grad = "Grad1" };
     repMock.Setup(x => x.GetEntityById(student.BI)).Returns(student);
     controller = new StudentsController(repMock.Object);
     var result = controller.Edit(student.BI) as ViewResult;
     Students s = result.ViewData.Model as Students;
     repMock.VerifyAll();
     Assert.AreEqual("Edit", result.ViewName);
     Assert.AreEqual("10011", s.BI);
 }
Exemplo n.º 2
0
 public void EditStudentsParam()
 {
     var repMock = new Mock<IFakultetRepository<Students>>();
     Students student = new Students() { BI = "10011", Ime = "Pera", Prezime = "Peric", Adresa = "Ulica1", Grad = "Grad1" };
     repMock.Setup(x => x.UpdateEntity(student));
     controller = new StudentsController(repMock.Object);
     var result = controller.Edit(student) as RedirectToRouteResult;
     repMock.VerifyAll();
     Assert.AreEqual("Index", result.RouteValues["Action"]);
 }