public void Execute_Test(Order order, string expected)
        {
            var cutomerNotifiermock = new Moq.Mock <ICutomerNotifier>(MockBehavior.Strict);

            cutomerNotifiermock.Setup(x => x.Notify());
            cutomerNotifiermock.Setup(x => x.Register(It.IsAny <RegistrationData>()));
            cutomerNotifiermock.Setup(x => x.Remove(It.IsAny <int>()));
            var sut = new ActivateMembershipRule(cutomerNotifiermock.Object);

            var actual = sut.Execute(order);

            Assert.That(expected, Is.EqualTo(actual));
            cutomerNotifiermock.Verify(m => m.Register(It.IsAny <RegistrationData>()), Moq.Times.Once);
            cutomerNotifiermock.Verify(m => m.Notify(), Moq.Times.Once);
        }
Esempio n. 2
0
 public ActivateMembershipRuleTests()
 {
     _mockCustomerAccountService = new Mock <ICustomerAccountService>();
     _activateMembershipRule     = new ActivateMembershipRule(_mockCustomerAccountService.Object);
 }