コード例 #1
0
        public async Task CreateNewMerchant_ThrowException()
        {
            MerchantHelper merchantHelper = new MerchantHelper(_mockLogger.Object, _mockDataAccess.Object);

            _mockDataAccess.Setup(x => x.CreateMerchantAccountAsync(It.IsAny <Merchant>())).ReturnsAsync(false);

            await Assert.ThrowsAsync <ArgumentOutOfRangeException>(() =>
                                                                   merchantHelper.CreateNewMerchantAsync()).ConfigureAwait(false);
        }
コード例 #2
0
        public async Task CreateNewMerchant_HappyPath()
        {
            MerchantHelper merchantHelper = new MerchantHelper(_mockLogger.Object, _mockDataAccess.Object);

            _mockDataAccess.Setup(x => x.CreateMerchantAccountAsync(It.IsAny <Merchant>())).ReturnsAsync(true);

            Merchant result = await merchantHelper.CreateNewMerchantAsync().ConfigureAwait(false);

            Assert.True(result.MerchantId.IsValid());
        }