public async Task Hatch4_GetToyDistributionList_ShouldSucceed() { var backendService = new BackendService(); var(christmasProject, reindeerLocations) = backendService.GetReindeerLocations(); var reindeerRescueResponse = await backendService.GetPostResponseAsync <ReindeerRescueResponse>("/api/reindeerrescue", new ReindeerRescueRequest() { Id = christmasProject.Id, Locations = reindeerLocations }); var toyDistributionProblem = backendService.GetToyDistribution(reindeerRescueResponse); toyDistributionProblem.Should().NotBeNull(); toyDistributionProblem.Toys.Count().Should().Be(15); toyDistributionProblem.Children.Length.Should().Be(15); toyDistributionProblem.Children.All(child => string.IsNullOrEmpty(child.Name) == false && child.Wishes.Toys.Length <= 3 && child.Wishes.Toys.All(toy => string.IsNullOrEmpty(toy.Name) == false && toyDistributionProblem.Toys.SingleOrDefault(availableToy => availableToy.Name == toy.Name) != null)); var santa = new Santa(); var toyDistributions = santa.DistributePresentsToChildren(toyDistributionProblem); toyDistributions.Should().NotBeNull(); toyDistributions.Count().Should().Be(15); toyDistributions.Distinct(new ToyDistributionComparer()).Count().Should().Be(15); var toyDistributionResponse = await backendService.GetPostResponseAsync <ToyDistributionResponse>("/api/toydistribution", new ToyDistributionRequest() { Id = christmasProject.Id, ToyDistribution = toyDistributions }); toyDistributionResponse.Should().NotBeNull(); toyDistributionResponse.Message.Should().NotBeNullOrEmpty(); }