45 lines
1.2 KiB
C#
45 lines
1.2 KiB
C#
using System.Collections.Generic;
|
|
using Xunit;
|
|
using Landmark.OLA.Models.Loan;
|
|
using Landmark.OLA.Models.Loan.Validators;
|
|
|
|
namespace Landmark.OLA.Tests.Loan.Validators
|
|
{
|
|
public class BranchConfigValidatorTest
|
|
{
|
|
|
|
[Fact]
|
|
public void NoDuplicateZipCodesTest()
|
|
{
|
|
var validator = new BranchConfigValidator();
|
|
|
|
var badConfig = new BranchConfig
|
|
{
|
|
BranchCodesByZip = [
|
|
new BranchData("53207", 1234567),
|
|
new BranchData("53207", 1234437)
|
|
]
|
|
};
|
|
|
|
var goodConfig = new BranchConfig
|
|
{
|
|
BranchCodesByZip = [
|
|
new BranchData("53207", 1234567),
|
|
new BranchData("53209", 1234437)
|
|
]
|
|
};
|
|
|
|
var singleConfig = new BranchConfig
|
|
{
|
|
BranchCodesByZip = [
|
|
new BranchData("53209", 1234437)
|
|
]
|
|
};
|
|
|
|
Assert.True(validator.Validate(singleConfig).IsValid);
|
|
Assert.True(validator.Validate(goodConfig).IsValid);
|
|
Assert.False(validator.Validate(badConfig).IsValid);
|
|
}
|
|
}
|
|
}
|