public void TestFindAll() { using (var repo = new KlantRepository(new KlantContext(_options))) { var klant = new Klant() { Voorletters = "YP" }; repo.Insert(klant); klant = new Klant() { Voorletters = "YPK" }; repo.Insert(klant); } using (var repo = new KlantRepository(new KlantContext(_options))) { Assert.AreEqual(2, repo.Count()); } }
public void TestFindAll() { using (var repo = new KlantRepository(new FrontEndContext(_options))) { Klant klant = new Klant() { Voorletters = "Y.P", Achternaam = "Keemink" }; repo.Insert(klant); klant = new Klant() { Voorletters = "Y.P", Achternaam = "Keemink2" }; repo.Insert(klant); } using (var repo = new KlantRepository(new FrontEndContext(_options))) { Assert.AreEqual(2, repo.Count()); } }
public void TestAdd() { using (var repo = new KlantRepository(new KlantContext(_options))) { repo.Insert(new Klant() { Voorletters = "YP" }); } using (var repo = new KlantRepository(new KlantContext(_options))) { Assert.AreEqual(1, repo.Count()); } }
public void TestAdd() { using (var repo = new KlantRepository(new FrontEndContext(_options))) { repo.Insert(new Klant() { Voorletters = "Y.P", Achternaam = "Keemink" }); } using (var repo = new KlantRepository(new FrontEndContext(_options))) { Assert.AreEqual(1, repo.Count()); } }
public void TestDelete() { using (var repo = new KlantRepository(new KlantContext(_options))) { var pen = new Klant() { Voorletters = "YP" }; repo.Insert(pen); repo.Delete(1); } using (var repo = new KlantRepository(new KlantContext(_options))) { Assert.AreEqual(0, repo.Count()); } }
public void TestFind() { using (var repo = new KlantRepository(new FrontEndContext(_options))) { repo.Insert(new Klant() { Voorletters = "Y.P", Achternaam = "Keemink" }); } using (var repo = new KlantRepository(new FrontEndContext(_options))) { var result = repo.Find(1); Assert.AreEqual(1, result.Id); Assert.AreEqual("Keemink", result.Achternaam); Assert.AreEqual("Y.P", result.Voorletters); } }
public void Repository_InsertsKlant() { // Arrange var options = CreateNewContextOptions(); IRepository target = new KlantRepository(options); var klant = new Klant() { }; // Act target.Insert(klant); // Assert using (var context = new KlantContext(options)) { Assert.AreEqual(1, context.Klanten.Count()); } }