public async Task GivenOrganisationsExist(Table table) { IDictionary <string, Guid> organisationDictionary = new Dictionary <string, Guid>(); foreach (var organisationTableItem in table.CreateSet <OrganisationTable>()) { var organisation = OrganisationEntityBuilder .Create() .WithName(organisationTableItem.Name) .WithOdsCode(organisationTableItem.OdsCode) .WithPrimaryRoleId(organisationTableItem.PrimaryRoleId) .WithCatalogueAgreementSigned(organisationTableItem.CatalogueAgreementSigned) .WithAddressLine1(organisationTableItem.Line1) .WithAddressLine2(organisationTableItem.Line2) .WithAddressLine3(organisationTableItem.Line3) .WithAddressLine4(organisationTableItem.Line4) .WithAddressTown(organisationTableItem.Town) .WithAddressCounty(organisationTableItem.County) .WithAddressPostcode(organisationTableItem.Postcode) .WithAddressCountry(organisationTableItem.Country) .Build(); await organisation.InsertAsync(_settings.ConnectionString); organisationDictionary.Add(organisation.Name, organisation.OrganisationId); } _context[ScenarioContextKeys.OrganisationMapDictionary] = organisationDictionary; }
public async Task Setup() { await Database.ClearAsync().ConfigureAwait(false); await OrganisationEntityBuilder.Create() .WithId(_org1Id) .Build() .InsertAsync() .ConfigureAwait(false); await SupplierEntityBuilder.Create() .WithId(_supplierId) .WithOrganisation(_org1Id) .Build() .InsertAsync() .ConfigureAwait(false); await SolutionEntityBuilder.Create() .WithId(_solutionId1) .WithOrganisationId(_org1Id) .WithSupplierId(_supplierId) .Build() .InsertAsync() .ConfigureAwait(false); _testContext = new TestContext(); _marketingContactRepository = _testContext.MarketingContactRepository; }
public async Task GivenOrganisationsExist(Table table) { var odsOrganisations = table.CreateSet <OdsApiResponseTable>(); foreach (OdsApiResponseTable org in odsOrganisations) { var odsApiOrganisation = TransformIntoOdsApiFormat(org); var odsApiOrganisationAsJson = JsonConvert.SerializeObject(odsApiOrganisation); await api.SetUpGetEndpoint(org.OdsCode, odsApiOrganisationAsJson); var organisation = OrganisationEntityBuilder .Create() .WithId(org.Id) .WithName(org.Name) .WithOdsCode(org.OdsCode) .WithAddressLine1(org.AddressLine1) .WithAddressLine2(org.AddressLine2) .WithAddressLine3(org.AddressLine3) .WithAddressLine4(org.AddressLine4) .WithAddressTown(org.Town) .WithAddressCounty(org.County) .WithAddressPostcode(org.PostCode) .WithAddressCountry(org.Country) .Build(); await organisation.InsertAsync(config.ConnectionString); } }
public async Task Setup() { await Database.ClearAsync().ConfigureAwait(false); await OrganisationEntityBuilder.Create() .WithName(_orgName) .WithId(_org1Id) .Build() .InsertAsync() .ConfigureAwait(false); await SupplierEntityBuilder.Create() .WithId(_supplierId) .WithOrganisation(_org1Id) .Build() .InsertAsync() .ConfigureAwait(false); await CapabilityEntityBuilder.Create().WithName("Cap1").WithId(_cap1Id).WithDescription("Cap1Desc").Build().InsertAsync() .ConfigureAwait(false); await CapabilityEntityBuilder.Create().WithName("Cap2").WithId(_cap2Id).WithDescription("Cap2Desc").Build().InsertAsync() .ConfigureAwait(false); TestContext testContext = new TestContext(); _solutionRepository = testContext.SolutionRepository; }
public async Task Setup() { await Database.ClearAsync().ConfigureAwait(false); await OrganisationEntityBuilder.Create() .WithId(_org1Id) .Build() .InsertAsync() .ConfigureAwait(false); await SupplierEntityBuilder.Create() .WithOrganisation(_org1Id) .WithId(SupplierId) .Build() .InsertAsync() .ConfigureAwait(false); await SolutionEntityBuilder.Create() .WithId(Solution1Id) .WithOrganisationId(_org1Id) .WithSupplierId(SupplierId) .Build() .InsertAsync() .ConfigureAwait(false); TestContext testContext = new TestContext(); _solutionCapabilityRepository = testContext.SolutionCapabilityRepository; }
private static async Task InsertOrganisationAsync(OrganisationTable organisationTable) { await OrganisationEntityBuilder.Create() .WithName(organisationTable.Name) .WithId(Guid.NewGuid()) .Build() .InsertAsync() .ConfigureAwait(false); }