コード例 #1
0
        private static DateTime END_OF_TIMES  = new DateTime(2025, 05, 05); // you don't wannna know

        public void ResidentialCustomerWithoutAccountsFailsWithNoAccounsEligibility()
        {
            var objectUnderTest = new ObjectUnderTestBuilder()
                                  .CreateCustomer(CustomerType.RESIDENTIAL)
                                  .Build();

            var communication = TestHelperWithAllTheStuff.PopulateDBAndStuff(objectUnderTest);

            var eligibilityResult = eligibilityService.performEligibility(communication);

            checkIneligible(eligibilityResult, NO_ACCOUNT_ELIGIBILITY_CODE);
        }
コード例 #2
0
        public void ResidentialCustomerWithElecAccountWithoutUsagesFailsWithNoUsageEligibility()
        {
            var objectUnderTest = new ObjectUnderTestBuilder()
                                  .CreateCustomer(CustomerType.RESIDENTIAL)
                                  .AddUtilityAccount(MeterType.ELEC, FuelType.KWH, ACTIVE_DATE)
                                  .Build();

            var communication = TestHelperWithAllTheStuff.PopulateDBAndStuff(objectUnderTest);

            var eligibilityResult = eligibilityService.performEligibility(communication);

            checkIneligible(eligibilityResult, USAGES_NOT_FOUND_ELIGIBILITY_CODE);
        }
コード例 #3
0
        public void IndustrialCustomerFailsWithNotSupportedCustomerTypeEligibility()
        {
            var objectUnderTest = new ObjectUnderTestBuilder()
                                  .CreateCustomer(CustomerType.INDUSTRIAL)
                                  .AddUtilityAccount(MeterType.ELEC, FuelType.KVAR, ACTIVE_DATE)
                                  .Build();

            var communication = TestHelperWithAllTheStuff.PopulateDBAndStuff(objectUnderTest);

            var eligibilityResult = eligibilityService.performEligibility(communication);

            checkIneligible(eligibilityResult, CUSTOMER_NOT_SUPPORTED_ELIGIBILITY_CODE);
        }
コード例 #4
0
        public void SolarCustomerFailsWithScrewYouSolarEligibility()
        {
            var objectUnderTest = new ObjectUnderTestBuilder()
                                  .CreateCustomer(CustomerType.RESIDENTIAL)
                                  .SetAsSolar()
                                  .AddUtilityAccount(MeterType.ELEC, FuelType.KWH, ACTIVE_DATE)
                                  .WithUsages(ACTIVE_DATE, END_OF_TIMES, 1, 0.2f)
                                  .Build();

            var communication = TestHelperWithAllTheStuff.PopulateDBAndStuff(objectUnderTest);

            var eligibilityResult = eligibilityService.performEligibility(communication);

            checkIneligible(eligibilityResult, SOLAR_ELIGIBILITY_CODE);
        }
コード例 #5
0
        public void ResidentialCustomerWithElecAndGasAccountsWithAllUsagesPassesEligibility()
        {
            var objectUnderTest = new ObjectUnderTestBuilder()
                                  .CreateCustomer(CustomerType.RESIDENTIAL)
                                  .AddUtilityAccount(MeterType.ELEC, FuelType.KWH, ACTIVE_DATE)
                                  .WithUsages(ACTIVE_DATE, END_OF_TIMES, 1, 0.2f)
                                  .AddUtilityAccount(MeterType.GAS, FuelType.M3, ACTIVE_DATE)
                                  .WithUsages(ACTIVE_DATE.AddYears(1), END_OF_TIMES, 0.2f, 0.01f)
                                  .Build();

            var communication = TestHelperWithAllTheStuff.PopulateDBAndStuff(objectUnderTest);

            var eligibilityResult = eligibilityService.performEligibility(communication);

            checkEligible(eligibilityResult);
        }