public void GetSpecifiekeCursistNaInsert() { using (var repo = new CursistRepositoryMock()) { //Arrange var target = new CursistController(repo); Cursist cursist = new Cursist() { Voornaam = "Kees", Achternaam = "Koning", CursusInstantieID = 1 }; target.Post(cursist); //Act target.Get(1); //Assert Assert.AreEqual(1, repo.TimesFindCalled); Assert.AreEqual(1, repo.FindByIdLastCallContent); } }
public void GetInschrijvingenCursus() { using (var repo = new CursistRepositoryMock()) { //Arrange var target = new CursistController(repo); Cursist cursist = new Cursist() { Voornaam = "Kees", Achternaam = "Koning", CursusInstantieID = 1 }; target.Post(cursist); //Act target.GetInschrijvingen(1); //Assert Assert.AreEqual(1, repo.TimesFindByCalled); } }
public void InsertNewCursist() { using (var repo = new CursistRepositoryMock()) { //Arrange var target = new CursistController(repo); Cursist cursist = new Cursist() { Voornaam = "Kees", Achternaam = "Koning", CursusInstantieID = 1 }; //Act target.Post(cursist); //Assert Assert.AreEqual(1, repo.TimesInsertCalled); Assert.AreEqual(cursist, repo.InsertLastCallContent); } }