示例#1
0
        public void AuthorizeReturnsUniqueId()
        {
            //Arrange
            _authRequest = new AuthorizeRequest()
            {
                CardNumber = "5105105105105100", Currency = "GBP", Amount = 20
            };
            var authId = "123-456";

            _mockLuhnCheckService.Setup(m => m.IsValidCardNumber(It.IsAny <string>())).Returns(true);
            _mockRepo.Setup(a => a.Authorize(It.IsAny <AuthorizeRequest>())).Returns(authId);

            //Act
            var authResponse = _authService.AuthorizeTransaction(_authRequest);

            //Assert
            Assert.AreEqual(authId, authResponse.AuthorizationId);
        }