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); }
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()); }