Ejemplo n.º 1
0
        public void CheckForCheckIn()
        {
            LibraryManager mgr = new LibraryManager();
            var book = new Book();
            var library = mgr.CheckInBook(book, DateTime.Parse("10/7/2015"));

            //mgr.AddBookToList(book);

            Assert.AreEqual(DateTime.Parse("10/7/2015"), library.ActualReturnDate);
            Assert.IsNull(library.ExpectedReturnDate);
        }
Ejemplo n.º 2
0
        public void CheckForCheckOut()
        {
            var book = new Book();
            var student = new Student();

            LibraryManager mgr = new LibraryManager();
            var library = mgr.CheckOutBook(book, student, DateTime.Parse("9/05/2004"));
            List<Library> libraries = new List<Library>();

            Assert.AreEqual(DateTime.Parse("9/05/2004"), library.BorrowDate);
            Assert.AreEqual(DateTime.Parse("10/05/2004"), library.ExpectedReturnDate);
        }
Ejemplo n.º 3
0
        public void CheckIfAgeIsCaluclatedCorrectly()
        {
            LibraryManager mgr = new LibraryManager();
            var student = new Student();
            const decimal expectedAge = 24m;
            decimal daysOfYear = 365m;

            student.DateOfBirth = DateTime.Now.AddDays((int)(-expectedAge * daysOfYear));

            mgr.AddStudentToList(student);

            Assert.AreEqual(expectedAge, student.Age);
        }