Exemplo n.º 1
0
        public async Task ShouldGetById()
        {
            await CatalogueItemEntityBuilder
            .Create()
            .WithCatalogueItemId(Solution1Id)
            .WithName("Solution1")
            .WithPublishedStatusId((int)PublishedStatus.Published)
            .WithSupplierId(SupplierId)
            .Build()
            .InsertAsync();

            await SolutionEntityBuilder.Create()
            .WithId(Solution1Id)
            .WithSummary("Sln1Summary")
            .WithFullDescription("Sln1Description")
            .WithAboutUrl("AboutUrl")
            .WithFeatures("Features")
            .WithClientApplication("Browser-based")
            .WithHosting("Hosting")
            .WithLastUpdated(lastUpdated)
            .Build()
            .InsertAsync();

            await FrameworkSolutionEntityBuilder.Create()
            .WithSolutionId(Solution1Id)
            .WithFrameworkId("NHSDGP001")
            .WithFoundation(false)
            .Build()
            .InsertAsync();

            var solution = await solutionRepository.ByIdAsync(Solution1Id, CancellationToken.None);

            solution.Id.Should().Be(Solution1Id);
            solution.Name.Should().Be("Solution1");
            solution.LastUpdated.Should().Be(lastUpdated);
            solution.Summary.Should().Be("Sln1Summary");
            solution.Description.Should().Be("Sln1Description");
            solution.AboutUrl.Should().Be("AboutUrl");
            solution.Features.Should().Be("Features");
            solution.ClientApplication.Should().Be("Browser-based");
            solution.Hosting.Should().Be("Hosting");
            solution.IsFoundation.Should().BeFalse();
            solution.PublishedStatus.Should().Be(PublishedStatus.Published);
        }
Exemplo n.º 2
0
        public async Task ShouldGetById()
        {
            await CatalogueItemEntityBuilder
            .Create()
            .WithCatalogueItemId(_solution1Id)
            .WithName("Solution1")
            .WithPublishedStatusId((int)PublishedStatus.Published)
            .WithSupplierId(_supplierId)
            .Build()
            .InsertAsync();

            await SolutionEntityBuilder.Create()
            .WithId(_solution1Id)
            .WithOnLastUpdated(_lastUpdated)
            .Build()
            .InsertAsync();

            await SolutionDetailEntityBuilder.Create()
            .WithSolutionId(_solution1Id)
            .WithSummary("Sln1Summary")
            .WithFullDescription("Sln1Description")
            .WithAboutUrl("AboutUrl")
            .WithFeatures("Features")
            .WithClientApplication("Browser-based")
            .WithHosting("Hosting")
            .WithLastUpdated(_lastUpdated)
            .Build()
            .InsertAndSetCurrentForSolutionAsync();

            var solution = await _solutionRepository.ByIdAsync(_solution1Id, new CancellationToken());

            solution.Id.Should().Be(_solution1Id);
            solution.Name.Should().Be("Solution1");
            solution.LastUpdated.Should().Be(_lastUpdated);
            solution.Summary.Should().Be("Sln1Summary");
            solution.Description.Should().Be("Sln1Description");
            solution.AboutUrl.Should().Be("AboutUrl");
            solution.Features.Should().Be("Features");
            solution.ClientApplication.Should().Be("Browser-based");
            solution.Hosting.Should().Be("Hosting");
            solution.IsFoundation.Should().BeFalse();
            solution.PublishedStatus.Should().Be(PublishedStatus.Published);
        }