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); }
public static Communication PopulateDBAndStuff(ObjectUnderTest objectUnderTest) { DatabasePopulationHelper.PopulateActualDBWithData(objectUnderTest.CustomerUnderTest); var customerId = objectUnderTest.CustomerUnderTest.ID; foreach (var utilityAccount in objectUnderTest.UtilityAccounts) { DatabasePopulationHelper.AddUtilityAcountToCustomer(customerId, utilityAccount); } foreach (var servicePointsUsage in objectUnderTest.ServicePointsUsages) { FakeMoosageResponse(servicePointsUsage.ServicePointId, servicePointsUsage.Usages); } var customerMultitenantId = objectUnderTest.CustomerUnderTest.MultitenantId.ToString(); FakeSolarServiceResponse(customerMultitenantId, objectUnderTest.IsSolar); FakeSomeOtherServiceResponse(objectUnderTest.SomeServiceMappingStuff?.NotCustomerMultitenantId, objectUnderTest.SomeServiceMappingStuff?.SomeData); return(CreateCommunicationWithAllThings()); }
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); }
public void Setup() { DatabasePopulationHelper.CleanUpDB(); }