Пример #1
0
        public void DeleteTechnology_Negative_ReturnsNotFound()
        {
            var    dataRepo   = new Mock <IDatabaseRepository>();
            string technology = "Java";

            dataRepo.Setup(d => d.DeleteTechnology(technology)).Returns(false);
            SMEController sMEController = new SMEController(dataRepo.Object);

            var actionResult = sMEController.Delete(technology, 0);

            Assert.NotNull(actionResult);
            Assert.IsType <NotFoundObjectResult>(actionResult);
        }
Пример #2
0
        public void DeleteTechnology_Positive_ReturnsOk()
        {
            var    dataRepo   = new Mock <IDatabaseRepository>();
            string technology = "C#";

            dataRepo.Setup(d => d.DeleteTechnology(technology)).Returns(true);
            SMEController sMEController = new SMEController(dataRepo.Object);

            var actionResult = sMEController.Delete(technology, 0);

            Assert.NotNull(actionResult);

            var okObjectResult = actionResult as OkObjectResult;

            Assert.NotNull(okObjectResult);
        }