public void SetUp() { var repo = new TenantXmlRepository(App.Path + "\\Tenant.Config"); var service = new TenantService(repo); _tenant = service.GetByHostHeader("www.ms121.com"); Assert.IsNotNull(_tenant, "Tenant should never be null!"); }
public static ActiveTenant WithSettings(this ActiveTenant tenant, IEnumerable <Setting> defaultSettings, IEnumerable <Setting> hostSettings) { var mergedAppSettings = new List <Setting>(); if ((hostSettings != null) && (hostSettings.Any())) { mergedAppSettings = hostSettings.Concat(defaultSettings).GroupBy(x => x.Key).Select(x => x.First()).ToList(); } else if (defaultSettings != null && defaultSettings.Any()) { mergedAppSettings = defaultSettings.ToList(); } tenant.InitializeSettings(mergedAppSettings); return(tenant); }
public static ActiveTenant WithCompany(this ActiveTenant tenant, Company company) { tenant.Company = company; return(tenant); }
public static ActiveTenant WithExternalId(this ActiveTenant tenant, string externalId) { tenant.ExternalId = externalId; return(tenant); }
public static ActiveTenant WithEnvironment(this ActiveTenant tenant, EnvironmentTypeEnum type) { tenant.Environment = type; return(tenant); }