Example #1
0
        public void AddPatron_AddsPatronToCopy_True()
        {
            Patron testPatron = new Patron("Penny Flowers");

            testPatron.Save();
            Copy newCopy = new Copy(1, 5, DateTime.Today);

            newCopy.Save();
            newCopy.AddPatron(testPatron);
            List <Patron> expected = new List <Patron> {
                testPatron
            };
            List <Patron> result = newCopy.GetPatrons();

            Assert.Equal(expected, result);
        }
Example #2
0
        public void T9_GetPatrons_ReturnsAllCopyPatrons()
        {
            Patron testPatron1 = new Patron("Sarah");

            testPatron1.Save();
            Patron testPatron2 = new Patron("John");

            testPatron2.Save();


            Copy testCopy = new Copy(5);

            testCopy.Save();

            testCopy.AddPatron(testPatron1);
            List <Patron> result   = testCopy.GetPatron();
            List <Patron> testList = new List <Patron> {
                testPatron1
            };

            Assert.Equal(testList, result);
        }
Example #3
0
        public void T8_Addpatron_AddspatronToCopy()
        {
            Book newBook = new Book("Freedom");

            newBook.Save();

            Patron testPatron = new Patron("Sarah");

            testPatron.Save();


            Copy testCopy = new Copy(1);

            testCopy.Save();

            testCopy.AddPatron(testPatron);
            List <Patron> result   = testCopy.GetPatron();
            List <Patron> testList = new List <Patron> {
                testPatron
            };

            Assert.Equal(testList, result);
        }
Example #4
0
        public void T9_GetPatrons_ReturnsAllCopyPatrons()
        {
            Patron testPatron1 = new Patron("Sarah");
              testPatron1.Save();
              Patron testPatron2 = new Patron("John");
              testPatron2.Save();

              Copy testCopy = new Copy(5);
              testCopy.Save();

              testCopy.AddPatron(testPatron1);
              List<Patron> result = testCopy.GetPatron();
              List<Patron> testList= new List<Patron>{testPatron1};

              Assert.Equal(testList,result);
        }
Example #5
0
        public void T8_Addpatron_AddspatronToCopy()
        {
            Book newBook = new Book("Freedom");
              newBook.Save();

              Patron testPatron = new Patron("Sarah");
              testPatron.Save();

              Copy testCopy = new Copy(1);
              testCopy.Save();

              testCopy.AddPatron(testPatron);
              List<Patron> result = testCopy.GetPatron();
              List<Patron> testList = new List<Patron> {testPatron};

              Assert.Equal(testList, result);
        }