コード例 #1
0
        public void TestGetDeductibleWithValidProductId()
        {
            // ----------------------
            // Test the happy path
            // ----------------------
            // Setup
            var mockRepository = new Mock <IBenefitRepository>();
            var mockDeduct     = new List <Deductible>();

            mockDeduct.Add(new Deductible()
            {
                Level = 1, Amount = 2000
            });
            mockDeduct.Add(new Deductible()
            {
                Level = 2, Amount = 3000
            });
            mockRepository.Setup(repository => repository.GetDeductible("ABC00001")).Returns(mockDeduct);

            //Execute
            var benefit = new MultiTierBenefit(mockRepository.Object);
            var deduct  = benefit.GetDeductible("ABC00001");

            //Assertion
            deduct.FirstOrDefault <Deductible>().Level.Should().Be(1);
            deduct.FirstOrDefault <Deductible>().Amount.Should().Be(2000);
        }
コード例 #2
0
        public void WhenIInquireTheDeductibleAmount()
        {
            var benefit = new MultiTierBenefit(_mockRepository.Object);

            _deduct = benefit.GetDeductible("ABC00001");
        }