Beispiel #1
0
        public void RecordEqualsTest()
        {
            var testRecord  = new SSE662Project1.Objects.Record(recordname);
            var testRecord2 = new SSE662Project1.Objects.Record(recordname2);

            Assert.False(testRecord.Equals(testRecord2));
            testRecord.AddExpense(testExpense);
            testRecord2.AddExpense(testExpense);
            Assert.False(testRecord.Equals(testRecord2));
            testRecord2.RecordName = recordname;
            Assert.True(testRecord.Equals(testRecord2));
        }
        public void ReadFromFileTest()
        {
            var f           = new FileReader();
            var testRecord  = new SSE662Project1.Objects.Record(recordname);
            var testRecord2 = new SSE662Project1.Objects.Record(recordname);

            testRecord.AddExpense(testExpense);
            testRecord.AddExpense(testExpense2);
            Assert.False(testRecord.Equals(testRecord2));
            f.ReadFromFile(filename, testRecord2);
            output.WriteLine(testRecord.ToString());
            output.WriteLine(testRecord2.ToString());
            Assert.True(testRecord.Equals(testRecord2));
        }