Example #1
0
        public void GetProjectNotFound()
        {
            // Set up Prerequisites
            var controller = new ProjectInfoAPIController();

            // Act
            IHttpActionResult actionResult = controller.GetProjectInfo(100);

            // Assert
            Assert.IsInstanceOfType(actionResult, typeof(NotFoundResult));
        }
Example #2
0
        public void ProjectGetByIdSuccess()
        {
            // Set up Prerequisites
            var controller = new ProjectInfoAPIController();

            // Act on Test
            var response      = controller.GetProjectInfo(1);
            var contentResult = response as OkNegotiatedContentResult <Project>;

            // Assert the result
            Assert.IsNotNull(contentResult);
            Assert.IsNotNull(contentResult.Content);
            Assert.AreEqual(1, contentResult.Content.Project_ID);
        }