Ejemplo n.º 1
0
        public void SetLastRecurrenceCreatedDateUpdated()
        {
            // Arrange
            DateTime                startDate  = DateTime.Now;
            const int               amount     = 123;
            const PaymentType       type       = PaymentType.Expense;
            const PaymentRecurrence recurrence = PaymentRecurrence.Daily;
            var          account = new Account("foo");
            const string note    = "asdf";

            var recurringPayment = new RecurringPayment(startDate,
                                                        amount,
                                                        type,
                                                        recurrence,
                                                        account,
                                                        note);

            // Act
            recurringPayment.SetLastRecurrenceCreatedDate();

            // Assert
            recurringPayment.LastRecurrenceCreated.ShouldBeInRange(DateTime.Now.AddSeconds(-1), DateTime.Now);
            recurringPayment.ModificationDate.ShouldBeInRange(DateTime.Now.AddSeconds(-1), DateTime.Now);
        }