public static MockModel Build() { var model = new MockModel(); var customers = CreateCustomers(); model.Customers = customers; model.OriginStrategies = CreateOriginStrategies(); model.PortalRoles = CreatePortalRoles(); model.ImageOptimisationPolicies = CreateImageOptimisationPolicies(); model.ThumbnailPolicies = CreateThumbnailPolicies(); model.PortalUserRoles = new Dictionary<string, List<string>>(); model.PortalUsers = CreatePortalUsers(customers, model.PortalRoles, model.PortalUserRoles); model.NamedQueries = CreateNamedQueries(customers); model.CustomerOriginStrategies = CreateCustomerOriginStrategies(customers, model.OriginStrategies); model.AuthServiceParentChild = new Dictionary<string, List<string>>(); var authServices = CreateAuthServices(customers, model.AuthServiceParentChild); model.AuthServices = authServices; model.RoleProviders = CreateRoleProviders(authServices); model.RoleAuthService = new Dictionary<string, string>(); var roles = CreateRoles(customers, authServices, model.RoleAuthService); model.Roles = roles; model.SpaceDefaultRoles = new Dictionary<string, List<string>>(); var spaces = CreateSpaces(customers, roles, model.SpaceDefaultRoles); model.Spaces = spaces; model.Queues = CreateQueues(customers); model.ImageRoles = new Dictionary<string, List<string>>(); var images = CreateImages(spaces, model.SpaceDefaultRoles, model.ImageRoles, model.ImageOptimisationPolicies, model.ThumbnailPolicies); model.Images = images; model.BatchImages = new Dictionary<string, List<string>>(); model.Batches = CreateBatches(images, model.BatchImages); RecalculateCounters(model); return model; }
public MockModel RebuildModel() { lock (ModelLock) { _model = MockModel.Build(); } return _model; }
public MockModel GetModel() { if (_model == null) { lock (ModelLock) { if (_model == null) { _model = MockModel.Build(); } } } return _model; }
public static void RecalculateCounters(MockModel model) { model.SetBatchCounts(); model.SetQueueSizes(); }