Ejemplo n.º 1
0
        public void CreateCustomerCreatesIndustrialCustomer()
        {
            var customerType = CustomerType.INDUSTRIAL;

            var objectUnderTest = new ObjectUnderTestBuilder()
                                  .CreateCustomer(customerType)
                                  .Build();
            var customerId = objectUnderTest.CustomerUnderTest.ID;

            TestHelperWithAllTheStuff.PopulateDBAndStuff(objectUnderTest);

            var customer = DatabasePopulationHelper.GetCustomerByIDFromRealDB(customerId);

            AssertCustomer(customer, customerType);
        }
Ejemplo n.º 2
0
        public void AddUtilityAccountForCustomerAddsGasWithM3ToForSpecifiedCustomer()
        {
            var customerType      = CustomerType.RESIDENTIAL;
            var expectedMeterType = MeterType.GAS;
            var expectedFuelType  = FuelType.M3;

            var objectUnderTest = new ObjectUnderTestBuilder()
                                  .CreateCustomer(customerType)
                                  .AddUtilityAccount(expectedMeterType, expectedFuelType, ACTIVE_DATE)
                                  .Build();
            var customerId = objectUnderTest.CustomerUnderTest.ID;

            TestHelperWithAllTheStuff.PopulateDBAndStuff(objectUnderTest);

            var customer        = DatabasePopulationHelper.GetCustomerByIDFromRealDB(customerId);
            var utilityAccounts = customer.UtilityAccounts;

            Assert.AreEqual(1, utilityAccounts.Count, "wrong number of utility accounts");

            var utilityAccount = utilityAccounts.First();

            AssertUtilityAccount(utilityAccount, expectedMeterType, expectedFuelType, ACTIVE_DATE, null);
        }