Ejemplo n.º 1
0
        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());
            }
        }
Ejemplo n.º 2
0
        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());
            }
        }
Ejemplo n.º 3
0
        public void CursistGetAll()
        {
            using (var repo = new CursistRepository(new DatabaseContext(_options)))
            {
                //Arrange

                //Act
                var result = repo.FindAll();
                //Assert
                Assert.IsInstanceOfType(result, typeof(IEnumerable <Cursist>));
            }
        }
Ejemplo n.º 4
0
 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());
     }
 }