Ejemplo n.º 1
0
        public void When_copying_record_will_create_new_object()
        {
            // Arrange
            var original_date = DateTime.Today;
            var original_unreconciled_amount = 12.34;
            var original_description         = "Description";
            var original_reconciled_amount   = 56.78;
            var cred_card1_in_out_record     = new CredCard1InOutRecord
            {
                Date = original_date,
                Unreconciled_amount = original_unreconciled_amount,
                Description         = original_description,
                Reconciled_amount   = original_reconciled_amount
            };

            cred_card1_in_out_record.Update_source_line_for_output(',');
            var original_source_line = cred_card1_in_out_record.OutputSourceLine;

            // Act
            var copied_record = (CredCard1InOutRecord)cred_card1_in_out_record.Copy();

            copied_record.Date = copied_record.Date.AddDays(1);
            copied_record.Unreconciled_amount = copied_record.Unreconciled_amount + 1;
            copied_record.Description         = copied_record.Description + "something else";
            copied_record.Reconciled_amount   = copied_record.Reconciled_amount + 1;
            copied_record.Update_source_line_for_output(',');

            // Assert
            Assert.AreEqual(original_date, cred_card1_in_out_record.Date);
            Assert.AreEqual(original_unreconciled_amount, cred_card1_in_out_record.Unreconciled_amount);
            Assert.AreEqual(original_description, cred_card1_in_out_record.Description);
            Assert.AreEqual(original_reconciled_amount, cred_card1_in_out_record.Reconciled_amount);
            Assert.AreEqual(original_source_line, cred_card1_in_out_record.OutputSourceLine);
        }
Ejemplo n.º 2
0
        public void When_copying_record_will_copy_all_important_data()
        {
            // Arrange
            var cred_card1_in_out_record = new CredCard1InOutRecord
            {
                Date = DateTime.Today,
                Unreconciled_amount = 12.34,
                Description         = "Description",
                Reconciled_amount   = 56.78
            };

            cred_card1_in_out_record.Update_source_line_for_output(',');

            // Act
            var copied_record = (CredCard1InOutRecord)cred_card1_in_out_record.Copy();

            // Assert
            Assert.AreEqual(cred_card1_in_out_record.Date, copied_record.Date);
            Assert.AreEqual(cred_card1_in_out_record.Unreconciled_amount, copied_record.Unreconciled_amount);
            Assert.AreEqual(cred_card1_in_out_record.Description, copied_record.Description);
            Assert.AreEqual(cred_card1_in_out_record.Reconciled_amount, copied_record.Reconciled_amount);
            Assert.AreEqual(cred_card1_in_out_record.OutputSourceLine, copied_record.OutputSourceLine);
        }