first commit
This commit is contained in:
+44
@@ -0,0 +1,44 @@
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user