Exemple #1
0
        public void CursusPutTest()
        {
            using (var repo = new CursusRepositoryMock())
            {
                Assert.AreEqual(0, repo.TimesUpdateCalled);

                var target = new CursusController(repo);

                var cursus = new Cursus()
                {
                    Cursuscode = "test",
                    Duur       = 5,
                    Titel      = "C# testing"
                };
                var cursusInstantie = new CursusInstantie()
                {
                    Startdatum = new DateTime(2016, 10, 10),
                    Cursus     = cursus
                };
                target.Put(cursusInstantie);

                Assert.AreEqual(1, repo.TimesUpdateCalled);
                Assert.AreEqual(cursusInstantie, repo.UpdateLastCallContent);
            }
        }