Exemplo n.º 1
0
        public void GetSpecifiekeCursistNaInsert()
        {
            using (var repo = new CursistRepositoryMock())
            {
                //Arrange
                var target = new CursistController(repo);


                Cursist cursist = new Cursist()
                {
                    Voornaam          = "Kees",
                    Achternaam        = "Koning",
                    CursusInstantieID = 1
                };
                target.Post(cursist);


                //Act
                target.Get(1);

                //Assert
                Assert.AreEqual(1, repo.TimesFindCalled);
                Assert.AreEqual(1, repo.FindByIdLastCallContent);
            }
        }
Exemplo n.º 2
0
        public void GetInschrijvingenCursus()
        {
            using (var repo = new CursistRepositoryMock())
            {
                //Arrange
                var target = new CursistController(repo);

                Cursist cursist = new Cursist()
                {
                    Voornaam          = "Kees",
                    Achternaam        = "Koning",
                    CursusInstantieID = 1
                };
                target.Post(cursist);
                //Act
                target.GetInschrijvingen(1);

                //Assert
                Assert.AreEqual(1, repo.TimesFindByCalled);
            }
        }
Exemplo n.º 3
0
        public void InsertNewCursist()
        {
            using (var repo = new CursistRepositoryMock())
            {
                //Arrange
                var target = new CursistController(repo);

                Cursist cursist = new Cursist()
                {
                    Voornaam          = "Kees",
                    Achternaam        = "Koning",
                    CursusInstantieID = 1
                };

                //Act
                target.Post(cursist);

                //Assert
                Assert.AreEqual(1, repo.TimesInsertCalled);
                Assert.AreEqual(cursist, repo.InsertLastCallContent);
            }
        }