public void Given_A_Product_Is_Null_When_Execute_Is_Called_Throws_ArgumentNullException()
        {
            //arrange
            var sut = new MembershipBusinessRule(_mockRepository.Object);

            // Act
            Action act = () => sut.Execute(null);

            //Assert
            act.Should().ThrowExactly <ArgumentNullException>();
        }
        public void Given_A_Upgrade_Membership_Product_When_Execute_Is_Called_Calls_PartnerServices_Twice()
        {
            //arrange
            var product = _fixture.Create <Membership>();

            product.IsUpgrade = true;
            var sut = new MembershipBusinessRule(_mockRepository.Object);

            _mockRepository.Setup(m => m.SendEmail()).Returns(Task.CompletedTask);
            _mockRepository.Setup(m => m.UpgradeMembership()).Returns(Task.CompletedTask);
            _mockRepository.Setup(m => m.ActivateMembership()).Returns(Task.CompletedTask);

            // Act
            sut.Execute(product);

            //Assert
            _mockRepository.Verify(m => m.SendEmail(), Times.Exactly(2));
        }
        public void Given_A_Product_When_Execute_Is_Called_Adds_GST_To_Final_Price()
        {
            //arrange
            var product = _fixture.Create <Membership>();

            product.Price     = 100;
            product.IsUpgrade = false;
            var sut = new MembershipBusinessRule(_mockRepository.Object);

            _mockRepository.Setup(m => m.SendEmail()).Returns(Task.CompletedTask);
            _mockRepository.Setup(m => m.ActivateMembership()).Returns(Task.CompletedTask);

            // Act
            sut.Execute(product);

            //Assert
            product.FinalPrice.Should().Equals(105);
        }