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

            _mockCosmoRepository.Setup(x => x.UpsertAsync(It.IsAny <FundingStreamPeriodProfilePattern>(), null, false, true))
            .ReturnsAsync(HttpStatusCode.OK);

            // act
            var result = await _repository.SaveFundingStreamPeriodProfilePattern(fundingStreamPeriodProfilePattern);

            // assert
            result.Should().Be(HttpStatusCode.OK);
            _mockCosmoRepository.Verify(x => x.UpsertAsync(It.Is <FundingStreamPeriodProfilePattern>(f => f.Id == fundingStreamPeriodProfilePatternId), null, false, true), Times.Once);
        }
        private FundingStreamPeriodProfilePattern NewFundingStreamPeriodProfilePattern(Action <FundingStreamPeriodProfilePatternBuilder> setUp = null)
        {
            FundingStreamPeriodProfilePatternBuilder profilePatternBuilder = new FundingStreamPeriodProfilePatternBuilder();

            setUp?.Invoke(profilePatternBuilder);

            return(profilePatternBuilder.Build());
        }