예제 #1
0
        public void CallTest()
        {
            //Arrange
            var domainStatUserRegistration1 = new DomainStatUserRegistration()
            {
                ProductName = ProductName.CicMac
            };
            var domainStatUserRegistration2 = new DomainStatUserRegistration()
            {
                ProductName = "ProductName"
            };
            var domainStatUserRegistration3 = new DomainStatUserRegistration();

            var domainReport = new DomainReport();

            var statUserRegistrationFilter = new Mock <IStatUserRegistrationFilter>();

            var cicMacRegistrationsFilter = new CicMacRegistrationsFilter();

            cicMacRegistrationsFilter.Set(statUserRegistrationFilter.Object);

            //Act
            cicMacRegistrationsFilter.Call(domainStatUserRegistration1, domainReport);
            cicMacRegistrationsFilter.Call(domainStatUserRegistration2, domainReport);
            cicMacRegistrationsFilter.Call(domainStatUserRegistration3, domainReport);

            //Assert
            Assert.AreEqual(1, domainReport.CicMacRegistrations);
            statUserRegistrationFilter.Verify(m => m.Call(domainStatUserRegistration1, domainReport), Times.Once());
            statUserRegistrationFilter.Verify(m => m.Call(domainStatUserRegistration2, domainReport), Times.Once());
            statUserRegistrationFilter.Verify(m => m.Call(domainStatUserRegistration3, domainReport), Times.Once());
        }
        public void CallTest()
        {
            //Arrange
            var domainStatUserRegistration1 = new DomainStatUserRegistration() { ProductName = ProductName.CicMac };
            var domainStatUserRegistration2 = new DomainStatUserRegistration() { ProductName = "ProductName" };
            var domainStatUserRegistration3 = new DomainStatUserRegistration();

            var domainReport = new DomainReport();

            var statUserRegistrationFilter = new Mock<IStatUserRegistrationFilter>();

            var cicMacRegistrationsFilter = new CicMacRegistrationsFilter();
            cicMacRegistrationsFilter.Set(statUserRegistrationFilter.Object);

            //Act
            cicMacRegistrationsFilter.Call(domainStatUserRegistration1, domainReport);
            cicMacRegistrationsFilter.Call(domainStatUserRegistration2, domainReport);
            cicMacRegistrationsFilter.Call(domainStatUserRegistration3, domainReport);

            //Assert
            Assert.AreEqual(1, domainReport.CicMacRegistrations);
            statUserRegistrationFilter.Verify(m => m.Call(domainStatUserRegistration1, domainReport), Times.Once());
            statUserRegistrationFilter.Verify(m => m.Call(domainStatUserRegistration2, domainReport), Times.Once());
            statUserRegistrationFilter.Verify(m => m.Call(domainStatUserRegistration3, domainReport), Times.Once());
        }