Test_MatchingEngineRule1_given_TheInsurerName_with_sample_Data_TheResult_should_NOT_contains_theExpected_itemName(
            string insurerName, string expectedItemName)
        {
            var items   = DataGenerator_sample1.GetTop3CarItemCoverCost();
            var insurer = DataGenerator_sample1.GetInsurer(insurerName);
            var sut     = new MatchingEngineRule1() as IMatchingEngineRule;
            var matched = sut.GetMatchedItems(items, insurer);

            Assert.DoesNotContain(expectedItemName, matched.Select(item => item.ItemName));
        }
Exemplo n.º 2
0
        public void IntegrationTest_CostCalculatorRule1_Given_SampleData_should_expectedCost_beEqual_with_actualCost(string insurerName,
                                                                                                                     decimal expectedCost)
        {
            var customerRequest    = DataGenerator_sample1.GenerateCustomerRequest();
            var insurer            = DataGenerator_sample1.GetInsurer(insurerName);
            var matchingEngine     = new MatchingEngineRule1() as IMatchingEngineRule;
            var filterRequestItems = new FilterRequestItemsRule1() as IFilterRequestItemsRule;

            var sut = new CostCalculatorRule1(matchingEngine, filterRequestItems) as ICostCalculatorRule;

            var actualCost = sut.GetCost(customerRequest.covers, insurer);

            Assert.Equal(expectedCost, actualCost);
        }
Exemplo n.º 3
0
        public void Test_QuoteEngine_with_Valid_data()
        {
            var req = DataGenerator_sample1.GenerateCustomerRequest();
            var config = DataGenerator_sample1.GenerateInsurerConfig();

            var matchingEngine = new MatchingEngineRule1() as IMatchingEngineRule;
            var filterRequestItems = new FilterRequestItemsRule1() as IFilterRequestItemsRule;
            var costCalculator = new CostCalculatorRule1(matchingEngine , filterRequestItems) as ICostCalculatorRule;
            
            IEngineQuoteService sut = new EngineQuoteService( costCalculator);

            var myQuotes = sut.GetQuotes(req, config);

            Assert.Equal(8, myQuotes[0].Price);
            Assert.Equal((decimal) 7.5, myQuotes[1].Price);
        }