Exemplo n.º 1
0
 public IDataEntity BuildOrgFundingDataEntity(OrgFunding orgFunding)
 {
     return(new DataEntity(Attributes.EntityOrgFunding)
     {
         Attributes = new Dictionary <string, IAttributeData>()
         {
             { Attributes.OrgFundEffectiveFrom, new AttributeData(orgFunding.OrgFundEffectiveFrom) },
             { Attributes.OrgFundEffectiveTo, new AttributeData(orgFunding.OrgFundEffectiveTo) },
             { Attributes.OrgFundFactor, new AttributeData(orgFunding.OrgFundFactor) },
             { Attributes.OrgFundFactType, new AttributeData(orgFunding.OrgFundFactType) },
             { Attributes.OrgFundFactValue, new AttributeData(orgFunding.OrgFundFactValue) },
         }
     });
 }
Exemplo n.º 2
0
        public void BuildOrgFunding()
        {
            var orgFunding = new OrgFunding()
            {
                UKPRN                = 12345678,
                OrgFundFactor        = "Factor",
                OrgFundFactType      = "Type",
                OrgFundFactValue     = "Value",
                OrgFundEffectiveFrom = new DateTime(2018, 8, 1),
                OrgFundEffectiveTo   = null,
            };

            var dataEntity = NewService().BuildOrgFundingDataEntity(orgFunding);

            dataEntity.EntityName.Should().Be("OrgFunding");
            dataEntity.Attributes.Should().HaveCount(5);
            dataEntity.Attributes["OrgFundFactor"].Value.Should().Be(orgFunding.OrgFundFactor);
            dataEntity.Attributes["OrgFundFactType"].Value.Should().Be(orgFunding.OrgFundFactType);
            dataEntity.Attributes["OrgFundFactValue"].Value.Should().Be(orgFunding.OrgFundFactValue);
            dataEntity.Attributes["OrgFundEffectiveFrom"].Value.Should().Be(orgFunding.OrgFundEffectiveFrom);
            dataEntity.Attributes["OrgFundEffectiveTo"].Value.Should().Be(orgFunding.OrgFundEffectiveTo);

            dataEntity.Children.Should().BeEmpty();
        }