Files
monorepo/LCU.API.Internal.OnlineLoanApp/Landmark.OLA.Tests/Services/CoreAccessServiceTest.cs
T
2026-03-11 11:18:25 -05:00

71 lines
2.1 KiB
C#

using System.Collections.Generic;
using Xunit;
using Landmark.OLA.Application.Services;
using Landmark.OLA.Models.Core;
namespace Landmark.OLA.Tests.Services
{
public class CoreAccessServiceTest
{
[Fact]
public void FindOwners_VariableResponses()
{
var service = new CoreAccessService();
// arrange
var owners = new List<CoreMemberOwner>()
{
new()
{
Name = "John Doe",
BirthDate = "2000-01-01",
TaxId = "111-22-3333"
},
new()
{
Name = "Jane Doe",
BirthDate = null,
TaxId = "111-22-4444"
},
new()
{
Name = "Janus Doe",
BirthDate = "1995-08-08",
TaxId = null
},
new()
{
Name = "Tester Doe",
BirthDate = "1995-09-08",
TaxId = "123-45-6789"
}
};
var find1 = new Application.Controllers.OnlineIdentityFormData() {
DateOfBirth = "09/08/1995",
SocialSecurityNumber = "6789"
};
var noFind1 = new Application.Controllers.OnlineIdentityFormData() {
DateOfBirth = "09/08/1995",
SocialSecurityNumber = "3333"
};
var noFind2 = new Application.Controllers.OnlineIdentityFormData() {
DateOfBirth = "01/01/2000",
SocialSecurityNumber = "6789"
};
// act
var found1 = service.FindMatchingOwner(find1, owners);
var notFound1 = service.FindMatchingOwner(noFind1, owners);
var notFound2 = service.FindMatchingOwner(noFind2, owners);
// assert
Assert.NotNull(found1);
Assert.Null(notFound1);
Assert.Null(notFound2);
Assert.Equal("Tester Doe", found1.Name);
}
}
}