Пример #1
0
        public void CallWhenNotSetFelterTest()
        {
            //Arrange
            var domainStatWatching = new DomainStatWatching();
            var domainReport = new DomainReport();
            
            var allViewsFilter = new TotalViewsFilter();

            //Act
            allViewsFilter.Call(domainStatWatching, domainReport);
            allViewsFilter.Call(domainStatWatching, domainReport);
            
            //Assert
            Assert.AreEqual(2, domainReport.TotalViews);
        }
        public void CallWhenNotSetFelterTest()
        {
            //Arrange
            var domainStatWatching = new DomainStatWatching();
            var domainReport       = new DomainReport();

            var allViewsFilter = new TotalViewsFilter();

            //Act
            allViewsFilter.Call(domainStatWatching, domainReport);
            allViewsFilter.Call(domainStatWatching, domainReport);

            //Assert
            Assert.AreEqual(2, domainReport.TotalViews);
        }
Пример #3
0
        public void CallTest()
        {
            //Arrange
            var domainStatWatching = new DomainStatWatching();
            var domainReport = new DomainReport();

            var statWatchingFilter = new Mock<IStatWatchingFilter>();

            var allViewsFilter = new TotalViewsFilter();
            allViewsFilter.Set(statWatchingFilter.Object);

            //Act
            allViewsFilter.Call(domainStatWatching, domainReport);

            //Assert
            Assert.AreEqual(1, domainReport.TotalViews);
            statWatchingFilter.Verify(m=>m.Call(domainStatWatching, domainReport), Times.Once());
        }
        public void CallTest()
        {
            //Arrange
            var domainStatWatching = new DomainStatWatching();
            var domainReport       = new DomainReport();

            var statWatchingFilter = new Mock <IStatWatchingFilter>();

            var allViewsFilter = new TotalViewsFilter();

            allViewsFilter.Set(statWatchingFilter.Object);

            //Act
            allViewsFilter.Call(domainStatWatching, domainReport);

            //Assert
            Assert.AreEqual(1, domainReport.TotalViews);
            statWatchingFilter.Verify(m => m.Call(domainStatWatching, domainReport), Times.Once());
        }