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

            Assert.NotEqual(testRecord.ToString(), testRecord2.ToString());
            testRecord.AddExpense(testExpense);
            testRecord2.AddExpense(testExpense);
            Assert.NotEqual(testRecord.ToString(), testRecord2.ToString());
            testRecord2.RecordName = recordname;
            Assert.Equal(testRecord.ToString(), testRecord2.ToString());
        }
예제 #2
0
        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));
        }