예제 #1
0
        public async Task ProfilePatternQueryRepository_ShouldDeleteFundingStreamPeriodProfilePatternById()
        {
            // arrange
            FundingStreamPeriodProfilePattern fundingStreamPeriodProfilePattern = _fundingStreamPeriodProfilePatternBuilder.Build();
            var fundingStreamPeriodProfilePatternId = fundingStreamPeriodProfilePattern.Id;

            _mockCosmoRepository.Setup(x => x.DeleteAsync <FundingStreamPeriodProfilePattern>(fundingStreamPeriodProfilePatternId, null, false))
            .ReturnsAsync(HttpStatusCode.OK);

            // act
            var result = await _repository.DeleteProfilePattern(fundingStreamPeriodProfilePatternId);

            // assert
            result.Should().Be(HttpStatusCode.OK);
            _mockCosmoRepository.Verify(x => x.DeleteAsync <FundingStreamPeriodProfilePattern>(It.Is <string>(id => id == fundingStreamPeriodProfilePatternId), null, false), Times.Once);
        }
 private Task <HttpStatusCode> WhenThePatternIsDeleted(string id)
 {
     return(_repository.DeleteProfilePattern(id));
 }