public void AddCursusInstantie() { using (var repo = new CursusInstantieRepository(new DatabaseContext(_options))) { repo.Insert(new CursusInstantie() { CursusId = "C1", StartDatum = new DateTime(2016, 10, 15), Cursus = new Cursus() { Code = "C1", Dagen = 3, Titel = "Cursus1" } }); } using (var repo = new CursusInstantieRepository(new DatabaseContext(_options))) { var result = repo.Find(1); Assert.AreEqual(1, repo.Count()); Assert.AreEqual("C1", result.CursusId); Assert.AreEqual(new DateTime(2016, 10, 15), result.StartDatum); } }
public void TestFindCursusInstantie() { using (var repo = new CursusInstantieRepository(new DatabaseContext(_options))) { repo.Insert(new CursusInstantie() { CursusId = "C1", StartDatum = new DateTime(2016, 10, 15), }); repo.Insert(new CursusInstantie() { CursusId = "C2", StartDatum = new DateTime(2016, 10, 15), }); } using (var repo = new CursusInstantieRepository(new DatabaseContext(_options))) { var result = repo.Find(1); Assert.AreEqual(1, result.Id); Assert.AreEqual("C1", result.CursusId); Assert.AreEqual(new DateTime(2016, 10, 15), result.StartDatum); } }