public static async Task ThenSolutionsAreLinkedToEpics(Table table)
        {
            foreach (var row in table.CreateSet <SolutionClaimedEpicTable>())
            {
                var epics = await SolutionEpicEntity.FetchAllEpicIdsForSolutionAsync(row.SolutionId);

                epics.Should().BeEquivalentTo(row.EpicIds);
            }
        }
        public async Task UpdateSolutionWithOneEpicAsync()
        {
            await InsertCapabilityAsync(_capDetails[0]);
            await InsertEpicAsync(_epicDetails[0]);

            var expectedClaimedEpic = new List <IClaimedEpicResult>
            {
                Mock.Of <IClaimedEpicResult>(e => e.EpicId == _epicDetails[0].Id && e.StatusName == StatusPassed)
            };

            await _solutionEpicRepository
            .UpdateSolutionEpicAsync(Solution1Id,
                                     Mock.Of <IUpdateClaimedEpicListRequest>(c => c.ClaimedEpics == expectedClaimedEpic), new CancellationToken());

            var solutionEpics = (await SolutionEpicEntity.FetchAllEpicIdsForSolutionAsync(Solution1Id)).ToList();

            solutionEpics.Count().Should().Be(1);
            solutionEpics[0].Should().Be(_epicDetails[0].Id);
        }
        public async Task UpdateSolutionWithMultipleEpicsAsync()
        {
            await InsertCapabilityAsync(_capDetails[0]);
            await InsertCapabilityAsync(_capDetails[1]);

            await InsertEpicAsync(_epicDetails[0]);
            await InsertEpicAsync(_epicDetails[1]);

            var expectedEpic = new List <IClaimedEpicResult>
            {
                Mock.Of <IClaimedEpicResult>(e => e.EpicId == _epicDetails[0].Id && e.StatusName == StatusPassed),
                Mock.Of <IClaimedEpicResult>(e => e.EpicId == _epicDetails[1].Id && e.StatusName == StatusPassed)
            };

            await _solutionEpicRepository
            .UpdateSolutionEpicAsync(Solution1Id,
                                     Mock.Of <IUpdateClaimedEpicListRequest>(c => c.ClaimedEpics == expectedEpic), new CancellationToken());

            var solutionEpics = (await SolutionEpicEntity.FetchAllEpicIdsForSolutionAsync(Solution1Id)).ToList();

            solutionEpics.Count().Should().Be(2);
            solutionEpics.Should().BeEquivalentTo(_epicDetails.Select(ed => ed.Id),
                                                  options => options.WithoutStrictOrdering());
        }