Пример #1
0
        public void SubscribeTest()
        {
            //Arrange:
            var testApp = new ApplicationUT(fileSystemVisitor);
            var appMock = new Moq.Mock <Application>(fileSystemVisitor)
            {
                CallBase = true
            };

            appMock
            .Protected()
            .Setup <bool>("Subscribe")
            .Returns(true);

            //Act:
            var result = testApp.SubscribeTest();

            appMock.Object.Start();

            //Assert:
            Assert.IsTrue(result);
            appMock.Protected().Verify("Subscribe", Times.Once());
        }