Beispiel #1
0
        public void CursusDeleteTest()
        {
            using (var repo = new CursusRepositoryMock())
            {
                Assert.AreEqual(0, repo.TimesDeleteCalled);

                var target = new CursusController(repo);

                target.Delete(2);

                Assert.AreEqual(1, repo.TimesDeleteCalled);
                Assert.AreEqual(2, repo.DeleteLastCallContent);
            }
        }
Beispiel #2
0
        public void DeleteNietBestaandeCursusFaalend()
        {
            using (var repo = new CursusRepositoryMock())
            {
                //Arrange

                var target = new CursusController(repo);

                //Act
                var result = target.Delete(1);

                //Assert
                Assert.AreEqual(1, repo.TimesDeleteCalled);
                Assert.IsInstanceOfType(result, typeof(BadRequestObjectResult));
            }
        }