Пример #1
0
        public void Test23()
        {
            Initial();
            int[] timeCheat = { 31, 03, 2018 };

            Librarian         lb = new Librarian("lb");
            Faculty           p1 = new Faculty("p1");
            Student           s  = new Student("s");
            VisitingProfessor v  = new VisitingProfessor("v");

            admin.ModifyLibrarian(lb.PersonID, "lb", "lb", "lb", 2);

            DocClass d1 = new DocClass("Introduction to Algorithms");
            DocClass d2 = new DocClass("Design Patterns: Elements of Reusable Object-Oriented Software");

            p1.CheckOut(d1.ID, timeCheat);
            s.CheckOut(d2.ID, timeCheat);
            v.CheckOut(d2.ID, timeCheat);
            lb.OutstandingRequest(d2.ID);

            timeCheat = new int[] { 02, 04, 2018 };
            DateTime Now = new DateTime(2018, 04, 14);

            p1.RenewDoc(d1.ID, timeCheat);
            s.RenewDoc(d2.ID, timeCheat);
            v.RenewDoc(d2.ID, timeCheat);

            Debug.Assert(SDM.LMS.GetCheckout(p1.PersonID, d1.ID).TimeToBack.Day == 30);
            Debug.Assert(SDM.LMS.GetCheckout(s.PersonID, d2.ID).TimeToBack.Day == Now.Day);
            Now = new DateTime(2018, 04, 07);
            Debug.Assert(SDM.LMS.GetCheckout(v.PersonID, d2.ID).TimeToBack.Day == Now.Day);
        }
Пример #2
0
        public void Test30()
        {
            Initial();

            Faculty           p1 = new Faculty("p1");
            VisitingProfessor v  = new VisitingProfessor("v");

            DocClass d1 = new DocClass("Introduction to Algorithms");

            p1.CheckOut(d1.ID, new int[] { 26, 03, 2018 });
            p1.RenewDoc(d1.ID, new int[] { 29, 03, 2018 });
            v.CheckOut(d1.ID, new int[] { 29, 03, 2018 });
            v.RenewDoc(d1.ID, new int[] { 30, 03, 2018 });

            List <CheckedOut> checkedOuts = SDM.LMS.GetCheckoutsList("p1");

            Debug.Assert(checkedOuts.First().CheckOutTime == 26);
            Debug.Assert(checkedOuts.First().DocumentCheckedOut == "Introduction to Algorithms");
            checkedOuts = SDM.LMS.GetCheckoutsList("v");
            Debug.Assert(checkedOuts.First().CheckOutTime == 5);
            Debug.Assert(checkedOuts.First().DocumentCheckedOut == "Introduction to Algorithms");
        }
Пример #3
0
        public void Test22()
        {
            Initial();
            int[] timeCheat = { 02, 04, 2018 };

            Faculty           p1 = new Faculty("p1");
            Student           s  = new Student("s");
            VisitingProfessor v  = new VisitingProfessor("v");

            DocClass d1 = new DocClass("Introduction to Algorithms");
            DocClass d2 = new DocClass("Design Patterns: Elements of Reusable Object-Oriented Software");

            p1.CheckOut(d1.ID, timeCheat);
            s.CheckOut(d2.ID, timeCheat);
            v.CheckOut(d2.ID, timeCheat);

            p1.RenewDoc(d1.ID, timeCheat);
            s.RenewDoc(d2.ID, timeCheat);
            v.RenewDoc(d2.ID, timeCheat);

            Debug.Assert(SDM.LMS.GetCheckout(p1.PersonID, d1.ID).TimeToBack.Day == 30);
            Debug.Assert(SDM.LMS.GetCheckout(s.PersonID, d2.ID).TimeToBack.Day == 16);
            Debug.Assert(SDM.LMS.GetCheckout(v.PersonID, d2.ID).TimeToBack.Day == 9);
        }