コード例 #1
0
        public void GetWithWrongString_ShouldReturnNull()
        {
            List<Klant> klanten = GetTestKlanten();
            KlantController controller = new KlantController(new MockKlantRepository(klanten));

            Klant resultKlant = controller.Get("Dezeklantkeybestaatniet");

            Assert.AreEqual(resultKlant, null);
        }
コード例 #2
0
        public void GetWithString_ShouldReturnKlant()
        {
            List<Klant> klanten = GetTestKlanten();
            KlantController controller = new KlantController(new MockKlantRepository(klanten));

            Klant resultKlant = controller.Get("henkieskey");

            Assert.AreEqual(resultKlant.Id, 1);
        }
コード例 #3
0
        public void GetWithWrongId_ShouldReturnNull()
        {
            List<Klant> klanten = GetTestKlanten();
            KlantController controller = new KlantController(new MockKlantRepository(klanten));

            Klant resultKlant = controller.Get(9999);

            Assert.AreEqual(resultKlant, null);
        }
コード例 #4
0
        public void GetWithId_ShouldReturnKlant()
        {
            List<Klant> klanten = GetTestKlanten();
            KlantController controller = new KlantController(new MockKlantRepository(klanten));

            Klant resultKlant = controller.Get(3);

            Assert.AreEqual(resultKlant.Klant_key, "klaasjeskey");
        }