Exemple #1
0
 public void Include(EntityData otherData)
 {
     Alerts.AddRange(otherData.Alerts);
     EmailAlertRecipients.AddRange(otherData.EmailAlertRecipients);
     SmsAlertRecipients.AddRange(otherData.SmsAlertRecipients);
     AlertReports.AddRange(otherData.AlertReports);
     AlertRules.AddRange(otherData.AlertRules);
     ApplicationLanguages.AddRange(otherData.ApplicationLanguages);
     ContentLanguages.AddRange(otherData.ContentLanguages);
     Countries.AddRange(otherData.Countries);
     DataCollectors.AddRange(otherData.DataCollectors);
     Districts.AddRange(otherData.Districts);
     GatewaySettings.AddRange(otherData.GatewaySettings);
     HeadManagerConsents.AddRange(otherData.HeadManagerConsents);
     HealthRisks.AddRange(otherData.HealthRisks);
     HealthRiskLanguageContents.AddRange(otherData.HealthRiskLanguageContents);
     Localizations.AddRange(otherData.Localizations);
     LocalizedTemplates.AddRange(otherData.LocalizedTemplates);
     NationalSocieties.AddRange(otherData.NationalSocieties);
     Notifications.AddRange(otherData.Notifications);
     Projects.AddRange(otherData.Projects);
     SupervisorUserProjects.AddRange(otherData.SupervisorUserProjects);
     ProjectHealthRisks.AddRange(otherData.ProjectHealthRisks);
     RawReports.AddRange(otherData.RawReports);
     Regions.AddRange(otherData.Regions);
     Reports.AddRange(otherData.Reports);
     Users.AddRange(otherData.Users);
     UserNationalSocieties.AddRange(otherData.UserNationalSocieties);
     Villages.AddRange(otherData.Villages);
     Zones.AddRange(otherData.Zones);
 }
        public INyssContext GetNyssContextMock()
        {
            var nyssContextMock = Substitute.For <INyssContext>();

            var nationalSocietiesDbSet  = NationalSocieties.AsQueryable().BuildMockDbSet();
            var healthRisksDbSet        = HealthRisks.AsQueryable().BuildMockDbSet();
            var alertRulesDbSet         = AlertRules.AsQueryable().BuildMockDbSet();
            var projectsDbSet           = Projects.AsQueryable().BuildMockDbSet();
            var projectHealthRisksDbSet = ProjectHealthRisks.AsQueryable().BuildMockDbSet();
            var dataCollectorsDbSet     = DataCollectors.AsQueryable().BuildMockDbSet();
            var reportsDbSet            = Reports.AsQueryable().BuildMockDbSet();
            var rawReportsDbSet         = RawReports.AsQueryable().BuildMockDbSet();
            var usersDbSet = Users.AsQueryable().BuildMockDbSet();
            var supervisorUserProjectsDbSet = SupervisorUserProjects.AsQueryable().BuildMockDbSet();
            var userNationalSocietiesDbSet  = UserNationalSocieties.AsQueryable().BuildMockDbSet();
            var regionsDbSet   = Regions.AsQueryable().BuildMockDbSet();
            var districtsDbSet = Districts.AsQueryable().BuildMockDbSet();
            var villagesDbSet  = Villages.AsQueryable().BuildMockDbSet();
            var zonesDbSet     = Zones.AsQueryable().BuildMockDbSet();
            var alertsDbSet    = Alerts.AsQueryable().BuildMockDbSet();

            nyssContextMock.NationalSocieties.Returns(nationalSocietiesDbSet);
            nyssContextMock.HealthRisks.Returns(healthRisksDbSet);
            nyssContextMock.AlertRules.Returns(alertRulesDbSet);
            nyssContextMock.Projects.Returns(projectsDbSet);
            nyssContextMock.ProjectHealthRisks.Returns(projectHealthRisksDbSet);
            nyssContextMock.DataCollectors.Returns(dataCollectorsDbSet);
            nyssContextMock.Reports.Returns(reportsDbSet);
            nyssContextMock.RawReports.Returns(rawReportsDbSet);
            nyssContextMock.Users.Returns(usersDbSet);
            nyssContextMock.SupervisorUserProjects.Returns(supervisorUserProjectsDbSet);
            nyssContextMock.UserNationalSocieties.Returns(userNationalSocietiesDbSet);
            nyssContextMock.Regions.Returns(regionsDbSet);
            nyssContextMock.Districts.Returns(districtsDbSet);
            nyssContextMock.Villages.Returns(villagesDbSet);
            nyssContextMock.Zones.Returns(zonesDbSet);
            nyssContextMock.Alerts.Returns(alertsDbSet);

            return(nyssContextMock);
        }