public void Tear_down() { OrganisationHandler.DeleteAllRecords(); OrganisationTypeHandler.DeleteRecord(_organisationTypeId1); ProviderTypeHandler.DeleteAllRecords(); OrganisationStatusHandler.DeleteRecords(new List <int> { _status1.Id }); }
public void Before_the_tests() { _lookupRepository = new LookupDataRepository(_databaseService.WebConfiguration, _cacheHelper); _providerTypeId1 = 1; _providerTypeId2 = 2; _organisationTypeId1WithProviderTypeId1CategoryId1 = 10; _organisationTypeId2WithProviderTypeId1CategoryId1 = 20; _organisationTypeId3WithProviderTypeId1CategoryId1 = 30; _organisationTypeId3WithProviderTypeId2CategoryId1 = 40; _organisationTypeId4WithProviderTypeId2 = 100; _cacheHelper.PurgeAllCaches(); _categoryId1 = 1; _categoryId2 = 2; OrganisationTypeHandler.InsertRecord(new OrganisationTypeModel { Id = _organisationTypeId1WithProviderTypeId1CategoryId1, CreatedAt = DateTime.Now, CreatedBy = "system", Status = "x", Type = "a" }); OrganisationTypeHandler.InsertRecord(new OrganisationTypeModel { Id = _organisationTypeId2WithProviderTypeId1CategoryId1, CreatedAt = DateTime.Now, CreatedBy = "system", Status = "x", Type = "b" }); OrganisationTypeHandler.InsertRecord(new OrganisationTypeModel { Id = _organisationTypeId3WithProviderTypeId1CategoryId1, CreatedAt = DateTime.Now, CreatedBy = "system", Status = "x", Type = "c" }); OrganisationTypeHandler.InsertRecord(new OrganisationTypeModel { Id = _organisationTypeId3WithProviderTypeId2CategoryId1, CreatedAt = DateTime.Now, CreatedBy = "system", Status = "x", Type = "c" }); OrganisationTypeHandler.InsertRecord(new OrganisationTypeModel { Id = _organisationTypeId4WithProviderTypeId2, CreatedAt = DateTime.Now, CreatedBy = "system", Status = "x", Type = "d" }); ProviderTypeHandler.InsertRecord(new ProviderTypeModel { Id = _providerTypeId1, CreatedAt = DateTime.Now, CreatedBy = "system", Status = "x", ProviderType = "a" }); ProviderTypeHandler.InsertRecord(new ProviderTypeModel { Id = _providerTypeId2, CreatedAt = DateTime.Now, CreatedBy = "system", Status = "x", ProviderType = "b" }); OrganisationCategoryHandler.InsertRecord(new OrganisationCategoryModel { Id = _categoryId1, Category = "category 1", CreatedAt = DateTime.Now, CreatedBy = "system", Status = "x" }); OrganisationCategoryHandler.InsertRecord(new OrganisationCategoryModel { Id = _categoryId2, Category = "category 2", CreatedAt = DateTime.Now, CreatedBy = "system", Status = "x" }); OrganisationCategoryOrgTypeProviderTypeHandler.InsertRecord(new OrganisationCategoryOrgTypeProviderTypeModel { Id = 1, OrganisationTypeId = _organisationTypeId1WithProviderTypeId1CategoryId1, ProviderTypeId = _providerTypeId1, OrganisationCategoryId = _categoryId1, CreatedAt = DateTime.Now, CreatedBy = "system", Status = "x" }); OrganisationCategoryOrgTypeProviderTypeHandler.InsertRecord(new OrganisationCategoryOrgTypeProviderTypeModel { Id = 2, OrganisationTypeId = _organisationTypeId2WithProviderTypeId1CategoryId1, ProviderTypeId = _providerTypeId1, OrganisationCategoryId = _categoryId1, CreatedAt = DateTime.Now, CreatedBy = "system", Status = "x" }); OrganisationCategoryOrgTypeProviderTypeHandler.InsertRecord(new OrganisationCategoryOrgTypeProviderTypeModel { Id = 3, OrganisationTypeId = _organisationTypeId3WithProviderTypeId1CategoryId1, ProviderTypeId = _providerTypeId1, OrganisationCategoryId = _categoryId1, CreatedAt = DateTime.Now, CreatedBy = "system", Status = "x" }); OrganisationCategoryOrgTypeProviderTypeHandler.InsertRecord(new OrganisationCategoryOrgTypeProviderTypeModel { Id = 4, OrganisationTypeId = _organisationTypeId3WithProviderTypeId2CategoryId1, ProviderTypeId = _providerTypeId2, OrganisationCategoryId = _categoryId1, CreatedAt = DateTime.Now, CreatedBy = "system", Status = "x" }); }
public void setup() { OrganisationStatusHandler.InsertRecords( new List <OrganisationStatusModel> { new OrganisationStatusModel { Id = OrganisationStatusHandler.Active, Status = "Active", CreatedAt = DateTime.Now, CreatedBy = "TestSystem" }, new OrganisationStatusModel { Id = OrganisationStatusHandler.Removed, Status = "Removed", CreatedAt = DateTime.Now, CreatedBy = "TestSystem" }, new OrganisationStatusModel { Id = OrganisationStatusHandler.ActiveNotTakingOnApprentices, Status = "Active - but not taking on apprentices", CreatedAt = DateTime.Now, CreatedBy = "TestSystem" }, new OrganisationStatusModel { Id = OrganisationStatusHandler.Onboarding, Status = "On-boarding", CreatedAt = DateTime.Now, CreatedBy = "TestSystem" } }); OrganisationTypeHandler.InsertRecords( new List <OrganisationTypeModel> { new OrganisationTypeModel { Id = 1, Status = "1", Type = "1", CreatedAt = DateTime.Now, CreatedBy = "TestSystem" }, new OrganisationTypeModel { Id = 2, Status = "2", Type = "2", CreatedAt = DateTime.Now, CreatedBy = "TestSystem" }, new OrganisationTypeModel { Id = 3, Status = "3", Type = "3", CreatedAt = DateTime.Now, CreatedBy = "TestSystem" }, new OrganisationTypeModel { Id = 4, Status = "4", Type = "4", CreatedAt = DateTime.Now, CreatedBy = "TestSystem" } }); ProviderTypeHandler.InsertRecords( new List <ProviderTypeModel> { new ProviderTypeModel { Id = 1, Status = "1", ProviderType = "1", CreatedAt = DateTime.Now, CreatedBy = "TestSystem" }, new ProviderTypeModel { Id = 2, Status = "2", ProviderType = "2", CreatedAt = DateTime.Now, CreatedBy = "TestSystem" }, new ProviderTypeModel { Id = 3, Status = "3", ProviderType = "3", CreatedAt = DateTime.Now, CreatedBy = "TestSystem" }, new ProviderTypeModel { Id = 4, Status = "4", ProviderType = "4", CreatedAt = DateTime.Now, CreatedBy = "TestSystem" } }); _repository = new FatDataExportRepository(new DatabaseService().DbConnectionHelper); }
public void Set_up_and_run_update() { _organisationStatusId1 = 1; _providerTypeId1 = 10; _providerTypeId2 = 20; _organisationTypeId1 = 100; _organisationTypeId2 = 111; _organisationUkprn = 11114433; _legalName = "Legal name 1"; _organisationId = Guid.NewGuid(); _updateOrganisationRepository = new UpdateOrganisationRepository(_databaseService.DbConnectionHelper); _repository = new OrganisationRepository(_databaseService.DbConnectionHelper); _status1 = new OrganisationStatusModel { Id = _organisationStatusId1, Status = "Live", CreatedAt = DateTime.Now, CreatedBy = "TestSystem" }; OrganisationStatusHandler.InsertRecord(_status1); _providerType1 = new ProviderTypeModel { Id = _providerTypeId1, ProviderType = "provider type 10", Description = "provider type description", CreatedAt = DateTime.Now, CreatedBy = "TestSystem", Status = "Live" }; ProviderTypeHandler.InsertRecord(_providerType1); _providerType2 = new ProviderTypeModel { Id = _providerTypeId2, ProviderType = "provider type 12", Description = "provider type description", CreatedAt = DateTime.Now, CreatedBy = "TestSystem", Status = "Live" }; ProviderTypeHandler.InsertRecord(_providerType2); _organisationTypeModel1 = new OrganisationTypeModel { Id = _organisationTypeId1, Type = "organisation type 10", Description = "organisation type description", CreatedAt = DateTime.Now, CreatedBy = "TestSystem", Status = "Live" }; OrganisationTypeHandler.InsertRecord(_organisationTypeModel1); _organisationTypeModel2 = new OrganisationTypeModel { Id = _organisationTypeId2, Type = "organisation type 22", Description = "organisation type description", CreatedAt = DateTime.Now, CreatedBy = "TestSystem", Status = "Live" }; OrganisationTypeHandler.InsertRecord(_organisationTypeModel2); _organisation = new OrganisationModel { UKPRN = _organisationUkprn, OrganisationTypeId = _organisationTypeId1, ProviderTypeId = _providerTypeId1, StatusId = _organisationStatusId1, StatusDate = DateTime.Today.AddDays(5), LegalName = _legalName, Id = _organisationId, CreatedAt = DateTime.Now, CreatedBy = "Test" }; OrganisationHandler.InsertRecord(_organisation); _changedBy = "SystemChange"; _successfulUpdate = _updateOrganisationRepository.UpdateProviderTypeAndOrganisationType(_organisationId, _providerTypeId2, _organisationTypeId2, _changedBy).Result; _newProviderType = _repository.GetProviderType(_organisationId).Result; _newOrganisationType = _repository.GetOrganisationType(_organisationId).Result; }
public void Set_up_and_run_update() { _organisationStatusId = 1; _providerTypeId = 10; _organisationTypeId = 100; _applicationDeterminedate = DateTime.Today; _newApplicationDeterminedDate = DateTime.Today.AddDays(-1); _organisationUkprn = 11114433; _organisationId = Guid.NewGuid(); _updateOrganisationRepository = new UpdateOrganisationRepository(_databaseService.DbConnectionHelper); _repository = new OrganisationRepository(_databaseService.DbConnectionHelper); _status = new OrganisationStatusModel { Id = _organisationStatusId, Status = "Live", CreatedAt = DateTime.Now, CreatedBy = "TestSystem" }; OrganisationStatusHandler.InsertRecord(_status); _providerType = new ProviderTypeModel { Id = _providerTypeId, ProviderType = "provider type 10", Description = "provider type description", CreatedAt = DateTime.Now, CreatedBy = "TestSystem", Status = "Live" }; ProviderTypeHandler.InsertRecord(_providerType); _organisationTypeModel = new OrganisationTypeModel { Id = _organisationTypeId, Type = "organisation type 10", Description = "organisation type description", CreatedAt = DateTime.Now, CreatedBy = "TestSystem", Status = "Live" }; OrganisationTypeHandler.InsertRecord(_organisationTypeModel); var organisationData = new OrganisationData { ApplicationDeterminedDate = _applicationDeterminedate }; _organisation = new OrganisationModel { UKPRN = _organisationUkprn, OrganisationTypeId = _organisationTypeId, ProviderTypeId = _providerTypeId, StatusId = _organisationStatusId, StatusDate = DateTime.Today.AddDays(5), LegalName = "legal name", Id = _organisationId, CreatedAt = DateTime.Now, CreatedBy = "Test", OrganisationData = JsonConvert.SerializeObject(organisationData) }; OrganisationHandler.InsertRecord(_organisation); _originalDeterminedDate = _repository.GetApplicationDeterminedDate(_organisationId).Result; _changedBy = "SystemChange"; _successfulUpdate = _updateOrganisationRepository.UpdateApplicationDeterminedDate(_organisationId, _newApplicationDeterminedDate.Value, _changedBy).Result; _newApplicationDeterminedDate = _repository.GetApplicationDeterminedDate(_organisationId).Result; }
public void Set_up_and_run_update() { _organisationStatusId1 = 1; _providerTypeId1 = 10; _organisationTypeId1 = 100; _organisationUkprn = 11114433; _organisationId = Guid.NewGuid(); _parentCompanyGuarantee = true; _parentCompanyGuaranteeAfterChange = false; _updateOrganisationRepository = new UpdateOrganisationRepository(_databaseService.WebConfiguration); _repository = new OrganisationRepository(_databaseService.WebConfiguration); _status1 = new OrganisationStatusModel { Id = _organisationStatusId1, Status = "Live", CreatedAt = DateTime.Now, CreatedBy = "TestSystem" }; OrganisationStatusHandler.InsertRecord(_status1); _providerType1 = new ProviderTypeModel { Id = _providerTypeId1, ProviderType = "provider type 10", Description = "provider type description", CreatedAt = DateTime.Now, CreatedBy = "TestSystem", Status = "Live" }; ProviderTypeHandler.InsertRecord(_providerType1); _organisationTypeModel1 = new OrganisationTypeModel { Id = _organisationTypeId1, Type = "organisation type 10", Description = "organisation type description", CreatedAt = DateTime.Now, CreatedBy = "TestSystem", Status = "Live" }; OrganisationTypeHandler.InsertRecord(_organisationTypeModel1); var organisationData = new OrganisationData { ParentCompanyGuarantee = _parentCompanyGuarantee }; _organisation = new OrganisationModel { UKPRN = _organisationUkprn, OrganisationTypeId = _organisationTypeId1, ProviderTypeId = _providerTypeId1, StatusId = _organisationStatusId1, StatusDate = DateTime.Today.AddDays(5), LegalName = "legal name", Id = _organisationId, CreatedAt = DateTime.Now, CreatedBy = "Test", OrganisationData = JsonConvert.SerializeObject(organisationData) }; OrganisationHandler.InsertRecord(_organisation); _originalParentCompanyGuarantee = _repository.GetParentCompanyGuarantee(_organisationId).Result; _changedBy = "SystemChange"; _successfulUpdate = _updateOrganisationRepository.UpdateParentCompanyGuarantee(_organisationId, _parentCompanyGuaranteeAfterChange, _changedBy).Result; _newParentCompanyGuarantee = _repository.GetParentCompanyGuarantee(_organisationId).Result; }
public void Set_up_and_run_update() { _organisationStatusId1 = 1; _providerTypeId1 = 10; _organisationTypeId1 = 100; _organisationUkprn = 11114433; _tradingName = "Trading name 1"; _tradingNameAfterChange = "Trading Name Version 2"; _organisationId = Guid.NewGuid(); _updateRepository = new UpdateOrganisationRepository(_databaseService.WebConfiguration); _repository = new OrganisationRepository(_databaseService.WebConfiguration); _status1 = new OrganisationStatusModel { Id = _organisationStatusId1, Status = "Live", CreatedAt = DateTime.Now, CreatedBy = "TestSystem" }; OrganisationStatusHandler.InsertRecord(_status1); _providerType1 = new ProviderTypeModel { Id = _providerTypeId1, ProviderType = "provider type 10", Description = "provider type description", CreatedAt = DateTime.Now, CreatedBy = "TestSystem", Status = "Live" }; ProviderTypeHandler.InsertRecord(_providerType1); _organisationTypeModel1 = new OrganisationTypeModel { Id = _organisationTypeId1, Type = "organisation type 10", Description = "organisation type description", CreatedAt = DateTime.Now, CreatedBy = "TestSystem", Status = "Live" }; OrganisationTypeHandler.InsertRecord(_organisationTypeModel1); _organisation = new OrganisationModel { UKPRN = _organisationUkprn, OrganisationTypeId = _organisationTypeId1, ProviderTypeId = _providerTypeId1, StatusId = _organisationStatusId1, StatusDate = DateTime.Today.AddDays(5), TradingName = _tradingName, LegalName = "Legal Name 1", Id = _organisationId, CreatedAt = DateTime.Now, CreatedBy = "Test" }; OrganisationHandler.InsertRecord(_organisation); _originalTradingName = _repository.GetTradingName(_organisationId).Result; _changedBy = "SystemChange"; _successfulUpdate = _updateRepository.UpdateTradingName(_organisationId, _tradingNameAfterChange, _changedBy).Result; _newTradingName = _repository.GetTradingName(_organisationId).Result; }
public void Before_the_tests() { _organisationStatusId1 = 1; _providerTypeId1 = ProviderType.MainProvider; _organisationTypeId1 = 100; _repository = new CreateOrganisationRepository(_databaseService.DbConnectionHelper); _status1 = new OrganisationStatusModel { Id = _organisationStatusId1, Status = "Live", CreatedAt = DateTime.Now, CreatedBy = "TestSystem" }; OrganisationStatusHandler.InsertRecord(_status1); _providerType1 = new ProviderTypeModel { Id = _providerTypeId1, ProviderType = "provider type 10", Description = "provider type description", CreatedAt = DateTime.Now, CreatedBy = "TestSystem", Status = "Live" }; ProviderTypeHandler.InsertRecord(_providerType1); _organisationTypeModel1 = new OrganisationTypeModel { Id = _organisationTypeId1, Type = "organisation type 10", Description = "organisation type description", CreatedAt = DateTime.Now, CreatedBy = "TestSystem", Status = "Live" }; OrganisationTypeHandler.InsertRecord(_organisationTypeModel1); }
public void Before_the_tests() { _lookupRepository = new LookupDataRepository(_databaseService.DbConnectionHelper, _cacheHelper); _providerTypeId1 = 1; _providerTypeId2 = 2; _organisationStatusId1WithProviderTypeId1 = 10; _organisationStatusId2WithProviderTypeId1 = 20; _organisationStatusId3WithProviderTypeId1 = 30; _organisationStatusId4WithProviderTypeId2 = 100; _cacheHelper.PurgeAllCaches(); OrganisationStatusHandler.InsertRecord(new OrganisationStatusModel { Id = _organisationStatusId1WithProviderTypeId1, CreatedAt = DateTime.Now, CreatedBy = "system", Status = "x" }); OrganisationStatusHandler.InsertRecord(new OrganisationStatusModel { Id = _organisationStatusId2WithProviderTypeId1, CreatedAt = DateTime.Now, CreatedBy = "system", Status = "x" }); OrganisationStatusHandler.InsertRecord(new OrganisationStatusModel { Id = _organisationStatusId3WithProviderTypeId1, CreatedAt = DateTime.Now, CreatedBy = "system", Status = "x" }); OrganisationStatusHandler.InsertRecord(new OrganisationStatusModel { Id = _organisationStatusId4WithProviderTypeId2, CreatedAt = DateTime.Now, CreatedBy = "system", Status = "x" }); ProviderTypeHandler.InsertRecord(new ProviderTypeModel { Id = _providerTypeId1, CreatedAt = DateTime.Now, CreatedBy = "system", Status = "x", ProviderType = "a" }); ProviderTypeHandler.InsertRecord(new ProviderTypeModel { Id = _providerTypeId2, CreatedAt = DateTime.Now, CreatedBy = "system", Status = "x", ProviderType = "b" }); ProviderTypeOrganisationStatusHandler.InsertRecord(new ProviderTypeOrganisationStatusModel { Id = 1, OrganisationStatusId = _organisationStatusId1WithProviderTypeId1, ProviderTypeId = _providerTypeId1 }); ProviderTypeOrganisationStatusHandler.InsertRecord(new ProviderTypeOrganisationStatusModel { Id = 2, OrganisationStatusId = _organisationStatusId2WithProviderTypeId1, ProviderTypeId = _providerTypeId1 }); ProviderTypeOrganisationStatusHandler.InsertRecord(new ProviderTypeOrganisationStatusModel { Id = 3, OrganisationStatusId = _organisationStatusId3WithProviderTypeId1, ProviderTypeId = _providerTypeId1 }); ProviderTypeOrganisationStatusHandler.InsertRecord(new ProviderTypeOrganisationStatusModel { Id = 4, OrganisationStatusId = _organisationStatusId4WithProviderTypeId2, ProviderTypeId = _providerTypeId2 }); }
public void setup_organisation_is_added() { _organisationStatusId1 = 1; _providerTypeId1 = 10; _organisationTypeId1 = 100; _organisationUkprn = 11114433; _organisationId = Guid.NewGuid(); _parentCompanyGuarantee = true; _repository = new OrganisationRepository(_databaseService.DbConnectionHelper); _status1 = new OrganisationStatusModel { Id = _organisationStatusId1, Status = "Live", CreatedAt = DateTime.Now, CreatedBy = "TestSystem" }; OrganisationStatusHandler.InsertRecord(_status1); _providerType1 = new ProviderTypeModel { Id = _providerTypeId1, ProviderType = "provider type 10", Description = "provider type description", CreatedAt = DateTime.Now, CreatedBy = "TestSystem", Status = "Live" }; ProviderTypeHandler.InsertRecord(_providerType1); _organisationTypeModel1 = new OrganisationTypeModel { Id = _organisationTypeId1, Type = "organisation type 10", Description = "organisation type description", CreatedAt = DateTime.Now, CreatedBy = "TestSystem", Status = "Live" }; OrganisationTypeHandler.InsertRecord(_organisationTypeModel1); var organisationData = new OrganisationData { ParentCompanyGuarantee = _parentCompanyGuarantee }; _organisation = new OrganisationModel { UKPRN = _organisationUkprn, OrganisationTypeId = _organisationTypeId1, ProviderTypeId = _providerTypeId1, StatusId = _organisationStatusId1, StatusDate = DateTime.Today.AddDays(5), LegalName = "legal name 1", Id = _organisationId, CreatedAt = DateTime.Now, CreatedBy = "Test", OrganisationData = JsonConvert.SerializeObject(organisationData) }; OrganisationHandler.InsertRecord(_organisation); }
public void setup_organisation_is_added() { _organisationStatusId1 = 1; _providerTypeId1 = 10; _organisationTypeId1 = 100; _organisationUkprn = 11114433; _tradingName = "Trading name 1"; _organisationId = Guid.NewGuid(); _repository = new OrganisationRepository(_databaseService.DbConnectionHelper); _status1 = new OrganisationStatusModel { Id = _organisationStatusId1, Status = "Live", CreatedAt = DateTime.Now, CreatedBy = "TestSystem" }; OrganisationStatusHandler.InsertRecord(_status1); _providerType1 = new ProviderTypeModel { Id = _providerTypeId1, ProviderType = "provider type 10", Description = "provider type description", CreatedAt = DateTime.Now, CreatedBy = "TestSystem", Status = "Live" }; ProviderTypeHandler.InsertRecord(_providerType1); _organisationTypeModel1 = new OrganisationTypeModel { Id = _organisationTypeId1, Type = "organisation type 10", Description = "organisation type description", CreatedAt = DateTime.Now, CreatedBy = "TestSystem", Status = "Live" }; OrganisationTypeHandler.InsertRecord(_organisationTypeModel1); _organisation = new OrganisationModel { UKPRN = _organisationUkprn, OrganisationTypeId = _organisationTypeId1, ProviderTypeId = _providerTypeId1, StatusId = _organisationStatusId1, StatusDate = DateTime.Today.AddDays(5), TradingName = _tradingName, LegalName = "legal name x", Id = _organisationId, CreatedAt = DateTime.Now, CreatedBy = "Test" }; OrganisationHandler.InsertRecord(_organisation); }
public void Tear_down() { ProviderTypeHandler.DeleteAllRecords(); }
public void Tear_down() { ProviderTypeOrganisationTypeHandler.DeleteAllRecords(); ProviderTypeHandler.DeleteAllRecords(); OrganisationTypeHandler.DeleteAllRecords(); }