public async Task ShouldUpdateSupplierStatus() { await CatalogueItemEntityBuilder .Create() .WithCatalogueItemId(_solution1Id) .WithName(_solution1Id) .WithPublishedStatusId((int)PublishedStatus.Published) .WithSupplierId(_supplierId) .Build() .InsertAsync(); await SolutionEntityBuilder.Create() .WithId(_solution1Id) .WithOnLastUpdated(_lastUpdated) .Build() .InsertAsync(); var mockUpdateSolutionSupplierStatusRequest = new Mock <IUpdateSolutionSupplierStatusRequest>(); mockUpdateSolutionSupplierStatusRequest.Setup(m => m.Id).Returns(_solution1Id); mockUpdateSolutionSupplierStatusRequest.Setup(m => m.SupplierStatusId).Returns(2); _solutionRepository.CheckExists(_solution1Id, new CancellationToken()).Result.Should().BeTrue(); await _solutionRepository.UpdateSupplierStatusAsync(mockUpdateSolutionSupplierStatusRequest.Object, new CancellationToken()); var solution = await SolutionEntity.GetByIdAsync(_solution1Id); solution.Id.Should().Be(_solution1Id); (await solution.LastUpdated.SecondsFromNow()).Should().BeLessOrEqualTo(5); }
public async Task ShouldUpdateSupplierStatus() { await SolutionEntityBuilder.Create() .WithName("Solution1") .WithId(_solution1Id) .WithOnLastUpdated(_lastUpdated) .WithOrganisationId(_org1Id) .WithSupplierId(_supplierId) .WithSupplierStatusId(1) .Build() .InsertAsync() .ConfigureAwait(false); var mockUpdateSolutionSupplierStatusRequest = new Mock <IUpdateSolutionSupplierStatusRequest>(); mockUpdateSolutionSupplierStatusRequest.Setup(m => m.Id).Returns(_solution1Id); mockUpdateSolutionSupplierStatusRequest.Setup(m => m.SupplierStatusId).Returns(2); _solutionRepository.CheckExists(_solution1Id, new CancellationToken()).Result.Should().BeTrue(); await _solutionRepository.UpdateSupplierStatusAsync(mockUpdateSolutionSupplierStatusRequest.Object, new CancellationToken()).ConfigureAwait(false); var solution = await SolutionEntity.GetByIdAsync(_solution1Id) .ConfigureAwait(false); solution.Id.Should().Be(_solution1Id); (await solution.LastUpdated.SecondsFromNow().ConfigureAwait(false)).Should().BeLessOrEqualTo(5); solution.SupplierStatusId.Should().Be(2); }
public static async Task ThenFieldSolutionSupplierStatusIdShouldCorrespondTo(string solutionId, string supplierStatusName) { var status = await SolutionSupplierStatusEntity.GetByNameAsync(supplierStatusName).ConfigureAwait(false); var solution = await SolutionEntity.GetByIdAsync(solutionId).ConfigureAwait(false); solution.SupplierStatusId.Should().Be(status.Id); }
public async Task ShouldUpdateImplementationTimescales() { const string expectedResult = "some implementation timescales description"; await CatalogueItemEntityBuilder .Create() .WithCatalogueItemId(_solution1Id) .WithName(_solution1Id) .WithPublishedStatusId((int)PublishedStatus.Published) .WithSupplierId(_supplierId) .Build() .InsertAsync(); await SolutionEntityBuilder.Create() .WithId(_solution1Id) .Build() .InsertAsync(); await SolutionDetailEntityBuilder.Create() .WithSolutionId(_solution1Id) .WithImplementationTimescales(expectedResult) .Build() .InsertAndSetCurrentForSolutionAsync(); var mockRequest = new Mock <IUpdateImplementationTimescalesRequest>(); mockRequest.Setup(m => m.SolutionId).Returns(_solution1Id); mockRequest.Setup(m => m.Description).Returns(expectedResult); await _solutionDetailRepository.UpdateImplementationTimescalesAsync(mockRequest.Object, new CancellationToken()); var solution = await SolutionEntity.GetByIdAsync(_solution1Id); solution.Id.Should().Be(_solution1Id); var marketingData = await SolutionDetailEntity.GetBySolutionIdAsync(_solution1Id); marketingData.ImplementationDetail.Should().Be(expectedResult); (await marketingData.LastUpdated.SecondsFromNow()).Should().BeLessOrEqualTo(5); }
public async Task ShouldUpdateFeatures() { await CatalogueItemEntityBuilder .Create() .WithCatalogueItemId(_solution1Id) .WithName(_solution1Id) .WithPublishedStatusId((int)PublishedStatus.Published) .WithSupplierId(_supplierId) .Build() .InsertAsync(); await SolutionEntityBuilder.Create() .WithId(_solution1Id) .Build() .InsertAsync(); await SolutionDetailEntityBuilder.Create() .WithSolutionId(_solution1Id) .WithAboutUrl("AboutUrl") .WithFeatures("Features") .Build() .InsertAndSetCurrentForSolutionAsync(); var mockUpdateSolutionFeaturesRequest = new Mock <IUpdateSolutionFeaturesRequest>(); mockUpdateSolutionFeaturesRequest.Setup(m => m.SolutionId).Returns(_solution1Id); mockUpdateSolutionFeaturesRequest.Setup(m => m.Features).Returns("Features4"); await _solutionDetailRepository.UpdateFeaturesAsync(mockUpdateSolutionFeaturesRequest.Object, new CancellationToken()); var solution = await SolutionEntity.GetByIdAsync(_solution1Id); solution.Id.Should().Be(_solution1Id); var marketingData = await SolutionDetailEntity.GetBySolutionIdAsync(_solution1Id); marketingData.AboutUrl.Should().Be("AboutUrl"); marketingData.Features.Should().Be("Features4"); (await marketingData.LastUpdated.SecondsFromNow()).Should().BeLessOrEqualTo(5); }
public async Task ShouldUpdateHosting() { const string expectedResult = "{ 'SomethingElse': [] }"; await CatalogueItemEntityBuilder .Create() .WithCatalogueItemId(_solution1Id) .WithName(_solution1Id) .WithPublishedStatusId((int)PublishedStatus.Published) .WithSupplierId(_supplierId) .Build() .InsertAsync(); await SolutionEntityBuilder.Create() .WithId(_solution1Id) .Build() .InsertAsync(); await SolutionDetailEntityBuilder.Create() .WithSolutionId(_solution1Id) .WithHosting("{ 'Something': [] }") .Build() .InsertAndSetCurrentForSolutionAsync(); var mockUpdateHostingRequest = new Mock <IUpdateSolutionHostingRequest>(); mockUpdateHostingRequest.Setup(m => m.SolutionId).Returns(_solution1Id); mockUpdateHostingRequest.Setup(m => m.Hosting).Returns(expectedResult); await _solutionDetailRepository.UpdateHostingAsync(mockUpdateHostingRequest.Object, new CancellationToken()); var solution = await SolutionEntity.GetByIdAsync(_solution1Id); solution.Id.Should().Be(_solution1Id); var marketingData = await SolutionDetailEntity.GetBySolutionIdAsync(_solution1Id); marketingData.Hosting.Should().Be(expectedResult); (await marketingData.LastUpdated.SecondsFromNow()).Should().BeLessOrEqualTo(5); }
public async Task ShouldUpdateClientApplicationType() { await SolutionEntityBuilder.Create() .WithName("Solution1") .WithId(_solution1Id) .WithOrganisationId(_org1Id) .WithSupplierId(_supplierId) .Build() .InsertAsync() .ConfigureAwait(false); await SolutionDetailEntityBuilder.Create() .WithSolutionId(_solution1Id) .WithAboutUrl("AboutUrl") .WithClientApplication("Browser-based") .Build() .InsertAndSetCurrentForSolutionAsync() .ConfigureAwait(false); var mockUpdateSolutionClientApplicationRequest = new Mock <IUpdateSolutionClientApplicationRequest>(); mockUpdateSolutionClientApplicationRequest.Setup(m => m.SolutionId).Returns(_solution1Id); mockUpdateSolutionClientApplicationRequest.Setup(m => m.ClientApplication).Returns("Browser-based"); await _solutionDetailRepository.UpdateClientApplicationAsync(mockUpdateSolutionClientApplicationRequest.Object, new CancellationToken()) .ConfigureAwait(false); var solution = await SolutionEntity.GetByIdAsync(_solution1Id) .ConfigureAwait(false); solution.Id.Should().Be(_solution1Id); var marketingData = await SolutionDetailEntity.GetBySolutionIdAsync(_solution1Id) .ConfigureAwait(false); marketingData.AboutUrl.Should().Be("AboutUrl"); marketingData.ClientApplication.Should().Be("Browser-based"); (await marketingData.LastUpdated.SecondsFromNow().ConfigureAwait(false)).Should().BeLessOrEqualTo(5); }
public async Task ShouldUpdateClientApplicationType() { await CatalogueItemEntityBuilder .Create() .WithCatalogueItemId(Solution1Id) .WithName(Solution1Id) .WithPublishedStatusId((int)PublishedStatus.Published) .WithSupplierId(SupplierId) .Build() .InsertAsync(); await SolutionEntityBuilder.Create() .WithId(Solution1Id) .WithAboutUrl("AboutUrl") .WithClientApplication("Native-Desktop") .Build() .InsertAsync(); var mockUpdateSolutionClientApplicationRequest = new Mock <IUpdateSolutionClientApplicationRequest>(); mockUpdateSolutionClientApplicationRequest.Setup(m => m.SolutionId).Returns(Solution1Id); mockUpdateSolutionClientApplicationRequest.Setup(m => m.ClientApplication).Returns("Browser-based"); await solutionRepository.UpdateClientApplicationAsync( mockUpdateSolutionClientApplicationRequest.Object, CancellationToken.None); var solution = await SolutionEntity.GetByIdAsync(Solution1Id); solution.SolutionId.Should().Be(Solution1Id); var marketingData = await SolutionEntity.GetByIdAsync(Solution1Id); marketingData.AboutUrl.Should().Be("AboutUrl"); marketingData.ClientApplication.Should().Be("Browser-based"); (await marketingData.LastUpdated.SecondsFromNow()).Should().BeLessOrEqualTo(5); }
public async Task ShouldUpdateRoadMap() { const string expectedResult = "some road map description"; await CatalogueItemEntityBuilder .Create() .WithCatalogueItemId(Solution1Id) .WithName(Solution1Id) .WithPublishedStatusId((int)PublishedStatus.Published) .WithSupplierId(SupplierId) .Build() .InsertAsync(); await SolutionEntityBuilder.Create() .WithId(Solution1Id) .WithRoadMap(expectedResult) .Build() .InsertAsync(); var mockRequest = new Mock <IUpdateRoadMapRequest>(); mockRequest.Setup(m => m.SolutionId).Returns(Solution1Id); mockRequest.Setup(m => m.Description).Returns(expectedResult); await solutionRepository.UpdateRoadMapAsync(mockRequest.Object, CancellationToken.None); var solution = await SolutionEntity.GetByIdAsync(Solution1Id); solution.SolutionId.Should().Be(Solution1Id); var marketingData = await SolutionEntity.GetByIdAsync(Solution1Id); marketingData.RoadMap.Should().Be(expectedResult); (await marketingData.LastUpdated.SecondsFromNow()).Should().BeLessOrEqualTo(5); }
public async Task ShouldUpdateSummary() { await SolutionEntityBuilder.Create() .WithName("Solution1") .WithId(_solution1Id) .WithOrganisationId(_org1Id) .WithSupplierId(_supplierId) .Build() .InsertAsync() .ConfigureAwait(false); await SolutionEntityBuilder.Create() .WithName("Solution2") .WithId(_solution2Id) .WithOrganisationId(_org1Id) .WithSupplierId(_supplierId) .Build() .InsertAsync() .ConfigureAwait(false); await SolutionDetailEntityBuilder.Create() .WithSolutionId(_solution1Id) .WithAboutUrl("AboutUrl1") .WithFeatures("Features") .WithClientApplication("Browser-based") .Build() .InsertAndSetCurrentForSolutionAsync() .ConfigureAwait(false); var mockUpdateSolutionSummaryRequest = new Mock <IUpdateSolutionSummaryRequest>(); mockUpdateSolutionSummaryRequest.Setup(m => m.SolutionId).Returns(_solution1Id); mockUpdateSolutionSummaryRequest.Setup(m => m.Summary).Returns("Sln4Summary"); mockUpdateSolutionSummaryRequest.Setup(m => m.Description).Returns("Sln4Description"); mockUpdateSolutionSummaryRequest.Setup(m => m.AboutUrl).Returns("AboutUrl4"); await _solutionDetailRepository.UpdateSummaryAsync(mockUpdateSolutionSummaryRequest.Object, new CancellationToken()) .ConfigureAwait(false); var solution = await SolutionEntity.GetByIdAsync(_solution1Id) .ConfigureAwait(false); solution.Id.Should().Be(_solution1Id); solution.Name.Should().Be("Solution1"); solution = await SolutionEntity.GetByIdAsync(_solution2Id) .ConfigureAwait(false); solution.Id.Should().Be(_solution2Id); solution.Name.Should().Be("Solution2"); var solutionDetail = await SolutionDetailEntity.GetBySolutionIdAsync(_solution1Id) .ConfigureAwait(false); solutionDetail.Summary.Should().Be("Sln4Summary"); solutionDetail.FullDescription.Should().Be("Sln4Description"); solutionDetail.AboutUrl.Should().Be("AboutUrl4"); solutionDetail.Features.Should().Be("Features"); solutionDetail.ClientApplication.Should().Be("Browser-based"); (await solutionDetail.LastUpdated.SecondsFromNow().ConfigureAwait(false)).Should().BeLessOrEqualTo(5); }
public static async Task LastUpdatedHasBeenUpdatedForSolution(string solutionId) { var contact = await SolutionEntity.GetByIdAsync(solutionId); (await contact.LastUpdated.SecondsFromNow()).Should().BeLessOrEqualTo(5); }
public async Task ShouldUpdateSummary() { await CatalogueItemEntityBuilder .Create() .WithCatalogueItemId(Solution1Id) .WithName(Solution1Id) .WithPublishedStatusId((int)PublishedStatus.Published) .WithSupplierId(SupplierId) .Build() .InsertAsync(); await CatalogueItemEntityBuilder .Create() .WithCatalogueItemId(Solution2Id) .WithName(Solution2Id) .WithPublishedStatusId((int)PublishedStatus.Published) .WithSupplierId(SupplierId) .Build() .InsertAsync(); await SolutionEntityBuilder.Create() .WithId(Solution2Id) .Build() .InsertAsync(); await SolutionEntityBuilder.Create() .WithId(Solution1Id) .WithAboutUrl("AboutUrl1") .WithFeatures("Features") .WithClientApplication("Browser-based") .Build() .InsertAsync(); var mockUpdateSolutionSummaryRequest = new Mock <IUpdateSolutionSummaryRequest>(); mockUpdateSolutionSummaryRequest.Setup(m => m.SolutionId).Returns(Solution1Id); mockUpdateSolutionSummaryRequest.Setup(m => m.Summary).Returns("Sln4Summary"); mockUpdateSolutionSummaryRequest.Setup(m => m.Description).Returns("Sln4Description"); mockUpdateSolutionSummaryRequest.Setup(m => m.AboutUrl).Returns("AboutUrl4"); await solutionRepository.UpdateSummaryAsync( mockUpdateSolutionSummaryRequest.Object, CancellationToken.None); var solution = await SolutionEntity.GetByIdAsync(Solution1Id); solution.SolutionId.Should().Be(Solution1Id); solution = await SolutionEntity.GetByIdAsync(Solution2Id); solution.SolutionId.Should().Be(Solution2Id); var solutionDetail = await SolutionEntity.GetByIdAsync(Solution1Id); solutionDetail.Summary.Should().Be("Sln4Summary"); solutionDetail.FullDescription.Should().Be("Sln4Description"); solutionDetail.AboutUrl.Should().Be("AboutUrl4"); solutionDetail.Features.Should().Be("Features"); solutionDetail.ClientApplication.Should().Be("Browser-based"); (await solutionDetail.LastUpdated.SecondsFromNow()).Should().BeLessOrEqualTo(5); }
public static async Task LastUpdatedHasUpdatedOnMarketingContact(string solutionId) { var contact = await SolutionEntity.GetByIdAsync(solutionId).ConfigureAwait(false); (await contact.LastUpdated.SecondsFromNow().ConfigureAwait(false)).Should().BeLessOrEqualTo(5); }