Ejemplo n.º 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);
        }
Ejemplo n.º 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);
        }