public void CallTest()
        {
            //Arrange
            var domainStatProjectState1 = new DomainStatProjectState()
            {
                Producer = ProductName.CicMac, IsSuccessfulUpload = true
            };
            var domainStatProjectState2 = new DomainStatProjectState()
            {
                Producer = ProductName.CicMac, IsSuccessfulUpload = false
            };
            var domainStatProjectState3 = new DomainStatProjectState()
            {
                Producer = "ProductName", IsSuccessfulUpload = true
            };

            var domainReport = new DomainReport();

            var statProjectUploadingFilter = new Mock <IStatProjectUploadingFilter>();

            var cicMacUploadsFilter = new CicMacUploadsFilter();

            cicMacUploadsFilter.Set(statProjectUploadingFilter.Object);

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

            //Assert
            Assert.AreEqual(1, domainReport.CicMacSuccessfulUploads);
            statProjectUploadingFilter.Verify(m => m.Call(domainStatProjectState1, domainReport), Times.Once());
            statProjectUploadingFilter.Verify(m => m.Call(domainStatProjectState2, domainReport), Times.Once());
            statProjectUploadingFilter.Verify(m => m.Call(domainStatProjectState3, domainReport), Times.Once());
        }
Ejemplo n.º 2
0
        public void CallTest()
        {
            //Arrange
            var domainStatProjectState1 = new DomainStatProjectState() { Producer = ProductName.CicMac, IsSuccessfulUpload = true };
            var domainStatProjectState2 = new DomainStatProjectState() { Producer = ProductName.CicMac, IsSuccessfulUpload = false };
            var domainStatProjectState3 = new DomainStatProjectState() { Producer = "ProductName", IsSuccessfulUpload = true };

            var domainReport = new DomainReport();

            var statProjectUploadingFilter = new Mock<IStatProjectUploadingFilter>();

            var cicMacUploadsFilter = new CicMacUploadsFilter();
            cicMacUploadsFilter.Set(statProjectUploadingFilter.Object);

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

            //Assert
            Assert.AreEqual(1, domainReport.CicMacSuccessfulUploads);
            statProjectUploadingFilter.Verify(m => m.Call(domainStatProjectState1, domainReport), Times.Once());
            statProjectUploadingFilter.Verify(m => m.Call(domainStatProjectState2, domainReport), Times.Once());
            statProjectUploadingFilter.Verify(m => m.Call(domainStatProjectState3, domainReport), Times.Once());
        }
Ejemplo n.º 3
0
        public void CallWhenNotSetFelterTest()
        {
            //Arrange
            var domainStatProjectState = new DomainStatProjectState() { Producer = ProductName.CicMac, IsSuccessfulUpload = true};
            var domainReport = new DomainReport();

            var cicMacUploadsFilter = new CicMacUploadsFilter();

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

            //Assert
            Assert.AreEqual(2, domainReport.CicMacSuccessfulUploads);
        }
        public void CallWhenNotSetFelterTest()
        {
            //Arrange
            var domainStatProjectState = new DomainStatProjectState()
            {
                Producer = ProductName.CicMac, IsSuccessfulUpload = true
            };
            var domainReport = new DomainReport();

            var cicMacUploadsFilter = new CicMacUploadsFilter();

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

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