public async Task ListAsync_FilterBySupplierId_ReturnsFilteredResult() { const string supId2 = "Sup2"; await SupplierEntityBuilder.Create() .WithId(supId2) .Build() .InsertAsync(); await CreateSimpleSolutionWithOneCap(Solution1Id); await CreateSimpleSolutionWithOneCap(Solution2Id, supId2); await CreateSimpleSolutionWithOneCap(Solution3Id); await CreateSimpleSolutionWithOneCap(Solution4Id, supId2); await FrameworkSolutionEntityBuilder.Create() .WithSolutionId(Solution1Id) .WithFrameworkId("NHSDGP001") .Build() .InsertAsync(); await FrameworkSolutionEntityBuilder.Create() .WithSolutionId(Solution3Id) .WithFrameworkId("NHSDGP001") .Build() .InsertAsync(); var solutions = (await solutionListRepository.ListAsync(false, SupplierId, null, CancellationToken.None)).ToList(); solutions.Count.Should().Be(2); solutions.Should().Contain(r => r.SupplierId == SupplierId); }
public async Task Setup() { await Database.ClearAsync(); await SupplierEntityBuilder.Create() .WithId(SupplierId) .Build() .InsertAsync(); await CatalogueItemEntityBuilder .Create() .WithCatalogueItemId(Solution1Id) .WithName(Solution1Id) .WithPublishedStatusId((int)PublishedStatus.Published) .WithSupplierId(SupplierId) .Build() .InsertAsync(); await SolutionEntityBuilder.Create() .WithId(Solution1Id) .Build() .InsertAsync(); TestContext testContext = new TestContext(); _solutionCapabilityRepository = testContext.SolutionCapabilityRepository; }
public async Task Setup() { await Database.ClearAsync(); await SupplierEntityBuilder.Create() .WithId(SupplierId) .WithName(SupplierName) .Build() .InsertAsync(); await CapabilityEntityBuilder .Create() .WithName("Cap1") .WithId(cap1Id) .WithCapabilityRef(CapabilityReference1) .WithDescription("Cap1Desc") .Build() .InsertAsync(); await CapabilityEntityBuilder.Create() .WithName("Cap2") .WithId(cap2Id) .WithCapabilityRef(CapabilityReference2) .WithDescription("Cap2Desc") .Build() .InsertAsync(); TestContext testContext = new TestContext(); solutionListRepository = testContext.SolutionListRepository; }
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(); await SupplierEntityBuilder.Create() .WithId(_supplierId) .Build() .InsertAsync(); await CatalogueItemEntityBuilder .Create() .WithCatalogueItemId(_solutionId1) .WithName(_solutionId1) .WithPublishedStatusId((int)PublishedStatus.Published) .WithSupplierId(_supplierId) .Build() .InsertAsync(); await SolutionEntityBuilder.Create() .WithId(_solutionId1) .Build() .InsertAsync(); _testContext = new TestContext(); _marketingContactRepository = _testContext.MarketingContactRepository; }
private async Task InsertSupplier(PublishedStatus solutionPublicationStatus = PublishedStatus.Published) { await SupplierEntityBuilder.Create() .WithId(_supplierId) .WithName(_supplierName) .WithSummary(_description) .WithSupplierUrl(_link) .WithAddress(_supplierAddress) .Build() .InsertAsync(); await SupplierContactEntityBuilder.Create() .WithId(Guid.NewGuid()) .WithSupplierId(_supplierId) .WithFirstName(_supplierContactFirstName) .WithLastName(_supplierContactLastName) .WithEmail(_supplierContactEmail) .WithPhoneNumber(_supplierContactPhoneNumber) .Build() .InsertAsync(); await CatalogueItemEntityBuilder .Create() .WithCatalogueItemId(_solutionId) .WithName(_solutionId) .WithSupplierId(_supplierId) .WithPublishedStatusId((int)solutionPublicationStatus) .Build() .InsertAsync(); await SolutionEntityBuilder.Create() .WithId(_solutionId) .Build() .InsertAsync(); }
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 InsertSupplierAsync(SupplierTable supplierTable) { await SupplierEntityBuilder.Create() .WithId(supplierTable.Id) .WithName(supplierTable.SupplierName) .WithSummary(supplierTable.Summary) .WithSupplierUrl(supplierTable.SupplierUrl) .WithAddress(supplierTable.Address) .Build() .InsertAsync(); }
private static async Task InsertSupplierAsync(SupplierTable supplierTable) { var organisations = (await OrganisationEntity.FetchAllAsync().ConfigureAwait(false)).ToList(); await SupplierEntityBuilder.Create() .WithId(supplierTable.Id) .WithOrganisation(organisations.First(o => o.Name == supplierTable.OrganisationName).Id) .WithName(supplierTable.Id) .Build() .InsertAsync() .ConfigureAwait(false); }
public async Task Setup() { await Database.ClearAsync(); await SupplierEntityBuilder.Create() .WithId(_supplierId) .Build() .InsertAsync(); TestContext testContext = new TestContext(); _solutionDetailRepository = testContext.SolutionDetailRepository; }
public async Task SetUp() { await Database.ClearAsync(); await SupplierEntityBuilder.Create() .WithId(SupplierId) .Build() .InsertAsync(); TestContext testContext = new TestContext(); additionalServiceRepository = testContext.AdditionalServiceRepository; }
public async Task SetUp() { await Database.ClearAsync(); await SupplierEntityBuilder.Create() .WithId(SupplierId1) .Build() .InsertAsync(); await SupplierEntityBuilder.Create() .WithId(SupplierId2) .Build() .InsertAsync(); TestContext testContext = new TestContext(); catalogueItemRepository = testContext.CatalogueItemRepository; }
public async Task ListAsync_FilterBySupplierId_ReturnsFilteredResult() { const string supId2 = "Sup2"; await SupplierEntityBuilder.Create() .WithId(supId2) .Build() .InsertAsync(); await CreateSimpleSolutionWithOneCap(Solution1Id); await CreateSimpleSolutionWithOneCap(Solution2Id, supId2); await CreateSimpleSolutionWithOneCap(Solution3Id); await CreateSimpleSolutionWithOneCap(Solution4Id, supId2); var solutions = await _solutionListRepository.ListAsync(false, _supplierId, new CancellationToken()); solutions.Count().Should().Be(2); solutions.Should().Contain(x => x.SupplierId == _supplierId); }