Files
monorepo/LCU.API.Collections.RepoApi-old/LCU.API.Collections.RepoApiTests/AlertCheckers/RtcLetterIsNullCheckerTest.cs
T
2026-04-20 14:47:24 -05:00

227 lines
7.4 KiB
C#

using System.Collections.Generic;
using LCU.API.Collections.CollectionsApiLib.Models;
using LCU.API.Collections.RepoApi.Domain.AlertChecker;
using LCU.API.Collections.RepoApi.Domain.Processing;
using LCU.Shared.Collections.RepoApiLib.Models;
using LCU.Shared.Collections.RepoApiLib.Models.Consumer;
using Xunit;
namespace LCU.API.Collections.RepoApiTests.AlertCheckers
{
public class RtcLetterIsNullCheckerTest
{
public RtcLetterIsNullCheckerTest()
{
}
private MemberDetail MakeMemberWithAddressInState(string state)
{
return new MemberDetail
{
Address = new AddressDetail
{
State = state
}
};
}
[Fact]
public void Create_RtcLetterWiAutoLoansFound_Ok()
{
var slip = new RepoAccountProcessingSlip()
{
Letters = new List<RepoLetter>
{
new RepoLetter
{
ActionCode = "RTC 3",
NoticeType = "RTC-WI-AUTO LOANS"
}
},
Member = MakeMemberWithAddressInState("WI"),
ExistingRepoAccount = new RepoAccount()
{
AccountNo = "123456-789",
Status = "RECA"
},
UpdatedRepoAccount = new RepoAccount()
{
AccountNo = "123456-789",
Status = "RECA",
Collaterals = new List<Collateral>
{
new Collateral
{
CollateralId = 1
}
}
}
};
var checker = new RtcLetterNotFoundChecker("RTC Letter", new List<string> { "RTC 1", "RTC 3" });
var result = checker.CheckForAlert(slip);
Assert.Null(result);
}
[Fact]
public void Create_RtcLetterWiNonAutoFound_Ok()
{
var slip = new RepoAccountProcessingSlip()
{
Letters = new List<RepoLetter>
{
new RepoLetter
{
ActionCode = "RTC 1",
NoticeType = "RTC WI- ATV,Boat, Snowmobile"
}
},
Member = MakeMemberWithAddressInState("WI"),
ExistingRepoAccount = new RepoAccount()
{
AccountNo = "123456-789",
Status = "RECA"
},
UpdatedRepoAccount = new RepoAccount()
{
AccountNo = "123456-789",
Status = "RECA",
Collaterals = new List<Collateral>
{
new Collateral
{
CollateralId = 1
}
}
}
};
var checker = new RtcLetterNotFoundChecker("RTC Letter", new List<string> { "RTC 1", "RTC 3" });
var result = checker.CheckForAlert(slip);
Assert.Null(result);
}
[Fact]
public void Create_RtcLetterIlNotApplicable_Ok()
{
var slip = new RepoAccountProcessingSlip()
{
Letters = new List<RepoLetter>(),
Member = MakeMemberWithAddressInState("IL"),
ExistingRepoAccount = new RepoAccount()
{
AccountNo = "123456-789",
Status = "RECA"
},
UpdatedRepoAccount = new RepoAccount()
{
AccountNo = "123456-789",
Status = "RECA",
Collaterals = new List<Collateral>
{
new Collateral
{
CollateralId = 1
}
}
}
};
var checker = new RtcLetterNotFoundChecker("RTC Letter", new List<string> { "RTC 1", "RTC 3" });
var result = checker.CheckForAlert(slip);
Assert.Null(result);
}
[Fact]
public void Create_RtcLetterWiVoluntary_Ok()
{
var slip = new RepoAccountProcessingSlip()
{
Letters = new List<RepoLetter>(),
Member = MakeMemberWithAddressInState("WI"),
ExistingRepoAccount = new RepoAccount()
{
AccountNo = "123456-789",
Status = "RECA",
Collaterals = new List<Collateral>
{
new Collateral
{
CollateralId = 1,
RepoCompanySelections = new List<RepoCompanySelection>
{
new RepoCompanySelection
{
Id = 1,
RepoType = RepoType.Voluntary
}
}
}
}
},
UpdatedRepoAccount = new RepoAccount()
{
AccountNo = "123456-789",
Status = "RECA",
Collaterals = new List<Collateral>
{
new Collateral
{
CollateralId = 1,
RepoCompanySelections = new List<RepoCompanySelection>
{
new RepoCompanySelection
{
Id = 1,
RepoType = RepoType.Voluntary
}
}
}
}
}
};
var checker = new RtcLetterNotFoundChecker("RTC Letter", new List<string> { "RTC 1", "RTC 3" });
var result = checker.CheckForAlert(slip);
Assert.Null(result);
}
[Fact]
public void Create_RtcLetterNotFound_Ok()
{
var slip = new RepoAccountProcessingSlip()
{
Letters = new List<RepoLetter>(),
Member = MakeMemberWithAddressInState("WI"),
ExistingRepoAccount = new RepoAccount()
{
RepoId = 5,
AccountNo = "123456-789",
Status = "RECA"
},
UpdatedRepoAccount = new RepoAccount()
{
RepoId = 5,
AccountNo = "123456-789",
Status = "RECA",
Collaterals = new List<Collateral>
{
new Collateral
{
CollateralId = 1
}
}
}
};
var checker = new RtcLetterNotFoundChecker("RTC Letter", new List<string> { "RTC 1", "RTC 3" });
var result = checker.CheckForAlert(slip);
Assert.Null(result);
}
}
}