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());
        }
Beispiel #2
0
 public ObjectUnderTestBuilder(string utilityCode = "TEST")
 {
     _utilityCode     = utilityCode;
     _objectUnderTest = new ObjectUnderTest();
 }