Beispiel #1
0
 public static async Task <PowerType> Load(WaDEContext db)
 {
     return(await Load(db, new PowerTypeBuilderOptions()));
 }
Beispiel #2
0
 public static async Task <SiteVariableAmountsFact> Load(WaDEContext db)
 {
     return(await Load(db, new SiteVariableAmountsFactBuilderOptions()));
 }
Beispiel #3
0
 public static async Task <ApplicableResourceType> Load(WaDEContext db)
 {
     return(await Load(db, new ApplicableResourceTypeBuilderOptions()));
 }
        public async Task LoadWaterAllocation_SimpleLoad()
        {
            OrganizationsDim organization;
            VariablesDim     variable;
            WaterSourcesDim  waterSource;
            MethodsDim       method;
            DateDim          dataPublicationDate;
            DateDim          allocationPriorityDate;
            WaterAllocation  waterAllocation;
            string           startTestString = "01/01";
            string           endTestString   = "12/01";

            using (var db = new WaDEContext(Configuration.GetConfiguration()))
            {
                organization = await OrganizationsDimBuilder.Load(db);

                variable = await VariablesDimBuilder.Load(db);

                waterSource = await WaterSourcesDimBuilder.Load(db);

                method = await MethodsDimBuilder.Load(db);

                dataPublicationDate = await DateDimBuilder.Load(db);

                allocationPriorityDate = await DateDimBuilder.Load(db);

                waterAllocation = WaterAllocationBuilder.Create(new WaterAllocationBuilderOptions {
                    RecordType = WaterAllocationRecordType.None
                });

                waterAllocation.OrganizationUUID         = organization.OrganizationUuid;
                waterAllocation.VariableSpecificUUID     = variable.VariableSpecificUuid;
                waterAllocation.WaterSourceUUID          = waterSource.WaterSourceUuid;
                waterAllocation.MethodUUID               = method.MethodUuid;
                waterAllocation.DataPublicationDate      = dataPublicationDate.Date;
                waterAllocation.AllocationPriorityDate   = allocationPriorityDate.Date;
                waterAllocation.AllocationTimeframeStart = startTestString;
                waterAllocation.AllocationTimeframeEnd   = endTestString;
            }

            var sut    = CreateWaterAllocationAccessor();
            var result = await sut.LoadWaterAllocation((new Faker()).Random.AlphaNumeric(10), new[] { waterAllocation });

            result.Should().BeTrue();

            using (var db = new WaDEContext(Configuration.GetConfiguration()))
            {
                var dbAllocationAmount = await db.AllocationAmountsFact.SingleAsync();

                dbAllocationAmount.AllocationAmountId.Should().NotBe(0);
                dbAllocationAmount.OrganizationId.Should().Be(organization.OrganizationId);
                dbAllocationAmount.VariableSpecificId.Should().Be(variable.VariableSpecificId);
                dbAllocationAmount.WaterSourceId.Should().Be(waterSource.WaterSourceId);
                dbAllocationAmount.MethodId.Should().Be(method.MethodId);
                dbAllocationAmount.DataPublicationDateId.Should().Be(dataPublicationDate.DateId);
                dbAllocationAmount.AllocationPriorityDateID.Should().Be(allocationPriorityDate.DateId);
                dbAllocationAmount.AllocationTimeframeStart.Should().Be(startTestString);
                dbAllocationAmount.AllocationTimeframeEnd.Should().Be(endTestString);
                db.ImportErrors.Should().HaveCount(0);
            }
        }
Beispiel #5
0
 public static async Task <DateDim> Load(WaDEContext db)
 {
     return(await Load(db, new DateDimBuilderOptions()));
 }
Beispiel #6
0
 public static async Task <VariablesDim> Load(WaDEContext db)
 {
     return(await Load(db, new VariablesDimBuilderOptions()));
 }
 public static async Task <Nhdproduct> Load(WaDEContext db)
 {
     return(await Load(db, new NhdproductBuilderOptions()));
 }
 public static async Task <WaterSourcesDim> Load(WaDEContext db)
 {
     return(await Load(db, new WaterSourcesDimBuilderOptions()));
 }
 public static async Task <RegulatoryStatus> Load(WaDEContext db)
 {
     return(await Load(db, new RegulatoryStatusBuilderOptions()));
 }
Beispiel #10
0
 public static async Task <ReportYearCv> Load(WaDEContext db)
 {
     return(await Load(db, new ReportYearCvBuilderOptions()));
 }
Beispiel #11
0
 public static async Task <IrrigationMethod> Load(WaDEContext db)
 {
     return(await Load(db, new IrrigationMethodBuilderOptions()));
 }
 public static async Task <AllocationAmountsFact> Load(WaDEContext db)
 {
     return(await Load(db, new AllocationAmountsFactBuilderOptions()));
 }
Beispiel #13
0
 public static async Task <ReportingUnitsDim> Load(WaDEContext db)
 {
     return(await Load(db, new ReportingUnitsDimBuilderOptions()));
 }