예제 #1
0
        public async Task AddLeadReferralAsync(ReferralLeadRequestModel leadRequestModel)
        {
            var result = await _referralService.AddReferralLeadAsync(_requestContext.UserId,
                                                                     _mapper.Map <ReferralLeadCreateModel>(leadRequestModel));

            if (result != null)
            {
                throw LykkeApiErrorException.BadRequest(result);
            }
        }
        public async Task ShouldReturnNull_WhenReferralPropertyCreatePasses()
        {
            // Arrange
            _referralClient.Setup(c => c.ReferralLeadApi.PostAsync(It.IsAny <ReferralLeadCreateRequest>()))
            .ReturnsAsync(new ReferralLeadCreateResponse()
            {
                ErrorCode = ReferralErrorCodes.None
            });

            // Act
            var result = await _referralService.AddReferralLeadAsync(Guid.NewGuid().ToString(), new ReferralLeadCreateModel
            {
                FirstName   = "fname",
                LastName    = "lname",
                Note        = "note",
                PhoneNumber = "number"
            });

            // Assert
            Assert.Null(result);
        }