Ejemplo n.º 1
0
        public void CallTest()
        {
            //Arrange
            var domainStatProjectState1 = new DomainStatProjectState()
            {
                Producer = ProductName.CicIPad, IsSuccessfulUpload = true
            };
            var domainStatProjectState2 = new DomainStatProjectState()
            {
                Producer = ProductName.CicIPad, IsSuccessfulUpload = false
            };
            var domainStatProjectState3 = new DomainStatProjectState()
            {
                Producer = "ProductName", IsSuccessfulUpload = true
            };

            var domainReport = new DomainReport();

            var statProjectDeletionFilter = new Mock <IStatProjectDeletionFilter>();

            var cicIPadDeletionsFilter = new CicIPadDeletionsFilter();

            cicIPadDeletionsFilter.Set(statProjectDeletionFilter.Object);

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

            //Assert
            Assert.AreEqual(1, domainReport.CicIPadDeletions);
            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.CicIPad, IsSuccessfulUpload = true };
            var domainStatProjectState2 = new DomainStatProjectState() { Producer = ProductName.CicIPad, IsSuccessfulUpload = false };
            var domainStatProjectState3 = new DomainStatProjectState() { Producer = "ProductName", IsSuccessfulUpload = true };

            var domainReport = new DomainReport();

            var statProjectDeletionFilter = new Mock<IStatProjectDeletionFilter>();

            var cicIPadDeletionsFilter = new CicIPadDeletionsFilter();
            cicIPadDeletionsFilter.Set(statProjectDeletionFilter.Object);

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

            //Assert
            Assert.AreEqual(1, domainReport.CicIPadDeletions);
            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.CicIPad, IsSuccessfulUpload = true };
            var domainReport = new DomainReport();

            var cicIPadDeletionsFilter = new CicIPadDeletionsFilter();

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

            //Assert
            Assert.AreEqual(2, domainReport.CicIPadDeletions);
        }
Ejemplo n.º 4
0
        public void CallWhenNotSetFelterTest()
        {
            //Arrange
            var domainStatProjectState = new DomainStatProjectState()
            {
                Producer = ProductName.CicIPad, IsSuccessfulUpload = true
            };
            var domainReport = new DomainReport();

            var cicIPadDeletionsFilter = new CicIPadDeletionsFilter();

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

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