public IDataEntity BuildApprenticeshipFinancialRecord(AppFinRecord appFinRecord) { return(new DataEntity(Attributes.EntityApprenticeshipFinancialRecord) { Attributes = new Dictionary <string, IAttributeData>() { { Attributes.AFinAmount, new AttributeData(appFinRecord.AFinAmount) }, { Attributes.AFinCode, new AttributeData(appFinRecord.AFinCode) }, { Attributes.AFinDate, new AttributeData(appFinRecord.AFinDate) }, { Attributes.AFinType, new AttributeData(appFinRecord.AFinType) } } }); }
public void BuildApprenticeshipFinancialRecord() { var appFinRecord = new AppFinRecord { AFinCode = 1, AFinAmount = 2, AFinDate = new DateTime(2019, 8, 1), AFinType = "Type" }; var dataEntity = NewService().BuildApprenticeshipFinancialRecord(appFinRecord); dataEntity.EntityName.Should().Be("ApprenticeshipFinancialRecord"); dataEntity.Attributes.Should().HaveCount(4); dataEntity.Attributes["AFinAmount"].Value.Should().Be(appFinRecord.AFinAmount); dataEntity.Attributes["AFinCode"].Value.Should().Be(appFinRecord.AFinCode); dataEntity.Attributes["AFinDate"].Value.Should().Be(appFinRecord.AFinDate); dataEntity.Attributes["AFinType"].Value.Should().Be(appFinRecord.AFinType); }