public void UpdateRecurringPayment_ValuesAssigned() { // Arrange var startDate = DateTime.Now.AddDays(-1); var endDate = DateTime.Now; const int amount = 123; const PaymentType type = PaymentType.Income; const PaymentRecurrence recurrence = PaymentRecurrence.Daily; var account = new Account("foo"); const string note = "asdf"; var recurringPayment = new RecurringPayment(startDate, 65, type, PaymentRecurrence.Monthly, new Account("1111"), "foo"); // Act recurringPayment.UpdateRecurringPayment(amount, recurrence, account, note, endDate); // Assert recurringPayment.StartDate.ShouldEqual(startDate); recurringPayment.EndDate.ShouldEqual(endDate); recurringPayment.Amount.ShouldEqual(amount); recurringPayment.Type.ShouldEqual(type); recurringPayment.Recurrence.ShouldEqual(recurrence); recurringPayment.ChargedAccount.ShouldEqual(account); recurringPayment.Note.ShouldEqual(note); }
public void UpdateRecurringPayment_CreationTimeSame() { // Arrange DateTime startDate = DateTime.Now.AddDays(-1); DateTime endDate = DateTime.Now; const int amount = 123; const PaymentType type = PaymentType.Income; const PaymentRecurrence recurrence = PaymentRecurrence.Daily; var account = new Account("foo"); const string note = "asdf"; var recurringPayment = new RecurringPayment(startDate, 65, type, PaymentRecurrence.Monthly, new Account("1111"), "foo"); DateTime creationTime = recurringPayment.CreationTime; // Act recurringPayment.UpdateRecurringPayment(amount, recurrence, account, note, endDate); // Assert recurringPayment.CreationTime.ShouldEqual(creationTime); }
public void UpdateRecurringPayment_EndDateSet_IsEndlessFalse() { // Arrange var recurringPayment = new RecurringPayment(DateTime.Now.AddDays(-1), 65, PaymentType.Income, PaymentRecurrence.Monthly, new Account("1111"), "foo"); // Act recurringPayment.UpdateRecurringPayment(123, PaymentRecurrence.Daily, new Account("123"), "", DateTime.Now); // Assert recurringPayment.IsEndless.ShouldBeFalse(); }