Esempio n. 1
0
        public void GetDefault_Test()
        {
            // Arrange
            var mockService = new Mock <IBranchService>();

            mockService.Setup(x => x.GetDefault())
            .Returns(new BranchModel {
                IsDefault = true
            });

            var controller = new BranchController(mockService.Object);


            // Act
            IHttpActionResult actionResult = controller.GetDefault();
            var contentResult = actionResult as OkNegotiatedContentResult <BranchModel>;

            // Assert
            Assert.IsNotNull(contentResult);
            Assert.IsNotNull(contentResult.Content);
            Assert.IsTrue(contentResult.Content.IsDefault);
        }