Esempio n. 1
0
        public void PopulateExternalData(int numberOfExternalEntities)
        {
            var externalDataFake = A.CollectionOfFake <Reportee>(numberOfExternalEntities).ToList();

            A.CallTo(() => _altinnClient.GetReportees())
            .Returns(externalDataFake);
        }
Esempio n. 2
0
        public async Task <IEnumerable <ExternalData> > GetExternalReportees()
        {
            var externalDataList = new List <ExternalData>();

            var reportees = await _altinnClient.GetReportees();

            foreach (var reportee in reportees)
            {
                var externalData = new ExternalData();

                externalData.Identifiers.Add(new Identifier {
                    Entity = IdentifierEntity.Reportee.ToString(), Property = IdentifierProperty.ReporteeId.ToString(), Value = reportee.ReporteeId
                });

                externalData.DataSet.Add(new Data {
                    Code = PropertyName.Name.ToString(), Value = reportee.Name
                });
                externalData.DataSet.Add(new Data {
                    Code = PropertyName.Type.ToString(), Value = reportee.Type
                });
                externalData.DataSet.Add(new Data {
                    Code = PropertyName.Status.ToString(), Value = reportee.Status
                });
                externalData.DataSet.Add(new Data {
                    Code = PropertyName.OrganizationNumber.ToString(), Value = reportee.OrganizationNumber
                });

                externalDataList.Add(externalData);
            }
            RemoveNullData(externalDataList);
            return(externalDataList);
        }