public void CursistInsert2ThenGetAllCount2() { using (var repo = new CursistRepository(new DatabaseContext(_options))) { //Arrange Cursist cursist = new Cursist() { Voornaam = "Kees", Achternaam = "Koning", CursusInstantieID = 1 }; Cursist cursist2 = new Cursist() { Voornaam = "Marco", Achternaam = "Pil", CursusInstantieID = 2 }; //Act repo.Insert(cursist); repo.Insert(cursist2); var result = repo.FindAll(); //Assert Assert.IsInstanceOfType(result, typeof(IEnumerable <Cursist>)); Assert.AreEqual(2, result.Count()); } }
public void CursistInsertDeleteThenGetAllCount0() { using (var repo = new CursistRepository(new DatabaseContext(_options))) { //Arrange var cursus = new Cursus() { Cursuscode = "test", Duur = 5, Titel = "C# testing" }; var cursusInstantie = new CursusInstantie() { Startdatum = new DateTime(2016, 10, 15), Cursus = cursus }; Cursist cursist = new Cursist() { Voornaam = "Kees", Achternaam = "Koning", CursusInstantieID = 1 }; //Act repo.Insert(cursist); repo.Delete(1); var result = repo.FindAll(); //Assert Assert.IsInstanceOfType(result, typeof(IEnumerable <Cursist>)); Assert.AreEqual(0, result.Count()); } }
public void CursistGetAll() { using (var repo = new CursistRepository(new DatabaseContext(_options))) { //Arrange //Act var result = repo.FindAll(); //Assert Assert.IsInstanceOfType(result, typeof(IEnumerable <Cursist>)); } }
public void CursistInsertThenGetAll() { using (var repo = new CursistRepository(new DatabaseContext(_options))) { //Arrange Cursist cursist = new Cursist(); //Act repo.Insert(cursist); var result = repo.FindAll(); //Assert Assert.IsInstanceOfType(result, typeof(IEnumerable <Cursist>)); Assert.AreEqual(1, result.Count()); } }
public void TestAddCursist() { using (var repo = new CursistRepository(new DatabaseContext(_options))) { repo.Insert(new Cursist() { Achternaam = "Keemink", Voornaam = "Yael" }); } using (var repo = new CursistRepository(new DatabaseContext(_options))) { Assert.AreEqual(1, repo.Count()); } }
public void TestFindCursus() { using (var repo = new CursistRepository(new DatabaseContext(_options))) { repo.Insert(new Cursist() { Achternaam = "Keemink", Voornaam = "Yael" }); } using (var repo = new CursistRepository(new DatabaseContext(_options))) { var result = repo.Find(1); Assert.AreEqual(1, result.Id); Assert.AreEqual("Keemink", result.Achternaam); Assert.AreEqual("Yael", result.Voornaam); } }