Ejemplo n.º 1
0
        public void Xact_Valid_FailsIfNoDateValue()
        {
            Xact xact = new Xact();

            Assert.False(xact.Valid());

            xact.Date = (Date)DateTime.Today;
            Assert.True(xact.Valid());
        }
Ejemplo n.º 2
0
        public void Journal_Valid_ReturnsFalseIfXactNotValid()
        {
            Journal journal = new Journal();

            journal.Master = new Account();
            Assert.True(journal.Valid());

            Xact xact = new Xact();

            xact.AddPost(new Post(journal.Master, new Amount(10)));
            xact.AddPost(new Post(journal.Master, new Amount(-10)));
            journal.AddXact(xact);

            Assert.False(xact.Valid()); // [DM] - Xact is not valid (but finalizable to add to the journal) because of no date.
            Assert.False(journal.Valid());
        }