52 lines
1.5 KiB
C#
52 lines
1.5 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Text;
|
|
using SUT = BrokerageLib;
|
|
|
|
namespace TestingLib
|
|
{
|
|
public class TestThePaymentDate
|
|
{
|
|
[CheckThisMethod]
|
|
public void DateIs30DaysInFuture()
|
|
{
|
|
var pd = new SUT.PaymentSystem.PaymentDate();
|
|
var sampleDate = DateTime.Parse("2019-12-16");
|
|
|
|
var futureDate = pd.CalculateFuturePaymentDate(sampleDate);
|
|
|
|
Assert.AreEqual(futureDate, sampleDate.AddDays(30), $"Expected date is not 30 days in the future.");
|
|
|
|
}
|
|
[CheckThisMethod]
|
|
public void ReturnsMondayIfProposedIsSunday()
|
|
{
|
|
|
|
var pd = new SUT.PaymentSystem.PaymentDate();
|
|
var sampleDate = DateTime.Parse("2019-12-13");
|
|
|
|
var futureDate = pd.CalculateFuturePaymentDate(sampleDate);
|
|
Assert.AreEqual(futureDate.DayOfWeek, DayOfWeek.Monday, $"Expected date is not Monday.");
|
|
}
|
|
[CheckThisMethod]
|
|
public void ReturnsMondayIfProposedIsSaturday()
|
|
{
|
|
var pd = new SUT.PaymentSystem.PaymentDate();
|
|
var sampleDate = DateTime.Parse("2019-12-12");
|
|
|
|
var futureDate = pd.CalculateFuturePaymentDate(sampleDate);
|
|
Assert.AreEqual(futureDate.DayOfWeek, DayOfWeek.Monday, $"Expected date is not Monday.");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
public struct UnitTestInfo
|
|
{
|
|
public bool DidTestPass { get; set; }
|
|
public string TestFailureMessage { get; set; }
|
|
public string MethodName { get; set; }
|
|
|
|
}
|
|
}
|