コード例 #1
0
        public void BlogNull_BlogIsNull_True()
        {
            // Expect
            var expect = true;

            // Arrange
            int blogID         = int.MaxValue;
            var mockdependency = new Mock <IBlogLogic>();

            mockdependency.Setup(s => s.BlogIsNull(blogID))
            .Returns(expect);

            // Actual
            var sut    = new BlogControllerFake(mockdependency.Object);
            var result = sut.BlogIsNull(blogID);

            // Assert
            Assert.Equal(expect, result);
        }
コード例 #2
0
        public void InputByteInt_BlogIsNull_False()
        {
            // Expect
            var expect = false;

            // Arrange
            byte blogID         = 95;
            var  mockdependency = new Mock <IBlogLogic>();

            mockdependency.Setup(s => s.BlogIsNull(blogID))
            .Returns(false);

            // Actual
            var sut    = new BlogControllerFake(mockdependency.Object);
            var result = sut.BlogIsNull(blogID);

            // Assert
            Assert.Equal(expect, result);
        }