예제 #1
0
        public async Task ValidationIfOneCapabilityRefDoesNotExistThenCountIsZero()
        {
            await InsertCapabilityAsync(_capDetails[0]);
            await InsertSolutionCapabilityAsync(Solution1Id, _capDetails[0].Id);

            IEnumerable <string> capabilityReferences = new List <string> {
                _capDetails[1].Reference
            };

            var count = await _solutionCapabilityRepository
                        .GetMatchingCapabilitiesCountAsync(capabilityReferences, new CancellationToken());

            count.Should().Be(0);
        }
        public async Task <bool> CheckCapabilityReferenceExists(IEnumerable <string> capabilitiesToMatch,
                                                                CancellationToken cancellationToken)
        {
            var count = await _solutionCapabilityRepository.GetMatchingCapabilitiesCountAsync(capabilitiesToMatch,
                                                                                              cancellationToken).ConfigureAwait(false);

            return(count == capabilitiesToMatch.ToList().Count);
        }