Пример #1
0
        public void CallTest()
        {
            //Arrange
            var domainStatProjectState1 = new DomainStatProjectState()
            {
                Producer = ProductName.CicPc, IsSuccessfulUpload = true
            };
            var domainStatProjectState2 = new DomainStatProjectState()
            {
                Producer = ProductName.CicPc, IsSuccessfulUpload = false
            };
            var domainStatProjectState3 = new DomainStatProjectState()
            {
                Producer = "ProductName", IsSuccessfulUpload = true
            };

            var domainReport = new DomainReport();

            var statProjectDeletionFilter = new Mock <IStatProjectDeletionFilter>();

            var cicPcDeletionsFilter = new CicPcDeletionsFilter();

            cicPcDeletionsFilter.Set(statProjectDeletionFilter.Object);

            //Act
            cicPcDeletionsFilter.Call(domainStatProjectState1, domainReport);
            cicPcDeletionsFilter.Call(domainStatProjectState2, domainReport);
            cicPcDeletionsFilter.Call(domainStatProjectState3, domainReport);

            //Assert
            Assert.AreEqual(1, domainReport.CicPcDeletions);
            statProjectDeletionFilter.Verify(m => m.Call(domainStatProjectState1, domainReport), Times.Once());
            statProjectDeletionFilter.Verify(m => m.Call(domainStatProjectState2, domainReport), Times.Once());
            statProjectDeletionFilter.Verify(m => m.Call(domainStatProjectState3, domainReport), Times.Once());
        }
        public void CallTest()
        {
            //Arrange
            var domainStatProjectState1 = new DomainStatProjectState() { Producer = ProductName.CicPc, IsSuccessfulUpload = true };
            var domainStatProjectState2 = new DomainStatProjectState() { Producer = ProductName.CicPc, IsSuccessfulUpload = false };
            var domainStatProjectState3 = new DomainStatProjectState() { Producer = "ProductName", IsSuccessfulUpload = true };

            var domainReport = new DomainReport();

            var statProjectDeletionFilter = new Mock<IStatProjectDeletionFilter>();

            var cicPcDeletionsFilter = new CicPcDeletionsFilter();
            cicPcDeletionsFilter.Set(statProjectDeletionFilter.Object);

            //Act
            cicPcDeletionsFilter.Call(domainStatProjectState1, domainReport);
            cicPcDeletionsFilter.Call(domainStatProjectState2, domainReport);
            cicPcDeletionsFilter.Call(domainStatProjectState3, domainReport);

            //Assert
            Assert.AreEqual(1, domainReport.CicPcDeletions);
            statProjectDeletionFilter.Verify(m => m.Call(domainStatProjectState1, domainReport), Times.Once());
            statProjectDeletionFilter.Verify(m => m.Call(domainStatProjectState2, domainReport), Times.Once());
            statProjectDeletionFilter.Verify(m => m.Call(domainStatProjectState3, domainReport), Times.Once());
        }
        public void CallWhenNotSetFelterTest()
        {
            //Arrange
            var domainStatProjectState = new DomainStatProjectState() { Producer = ProductName.CicPc, IsSuccessfulUpload = true };
            var domainReport = new DomainReport();

            var cicPcDeletionsFilter = new CicPcDeletionsFilter();

            //Act
            cicPcDeletionsFilter.Call(domainStatProjectState, domainReport);
            cicPcDeletionsFilter.Call(domainStatProjectState, domainReport);

            //Assert
            Assert.AreEqual(2, domainReport.CicPcDeletions);
        }
Пример #4
0
        public void CallWhenNotSetFelterTest()
        {
            //Arrange
            var domainStatProjectState = new DomainStatProjectState()
            {
                Producer = ProductName.CicPc, IsSuccessfulUpload = true
            };
            var domainReport = new DomainReport();

            var cicPcDeletionsFilter = new CicPcDeletionsFilter();

            //Act
            cicPcDeletionsFilter.Call(domainStatProjectState, domainReport);
            cicPcDeletionsFilter.Call(domainStatProjectState, domainReport);

            //Assert
            Assert.AreEqual(2, domainReport.CicPcDeletions);
        }