Example #1
0
        public void GetSalespersonNotFoundTest()
        {
            //Arrange
            var controller = new SalespersonController();
            //Act
            IHttpActionResult result = controller.GetSalesperson(100);

            //Assert
            Assert.IsInstanceOfType(result, typeof(NotFoundResult));
        }
Example #2
0
        public void GetSalespersonByIdTest()
        {
            //Arrange
            var controller = new SalespersonController();
            //Act
            IHttpActionResult result = controller.GetSalesperson(1);
            var contentResult        = result as OkNegotiatedContentResult <Salesperson>;

            //Assert
            Assert.IsNotNull(contentResult);
            Assert.IsNotNull(contentResult.Content);
            Assert.AreEqual(1, contentResult.Content.Id);
        }