public void Copies_GetAll_DatabaseEmpty()
        {
            List <Copies> newCopies  = Copies.GetAll();
            List <Copies> testCopies = new List <Copies> {
            };

            Assert.Equal(newCopies, testCopies);
        }
        public void Copies_Save_SaveCopiesToDatabase()
        {
            Copies newCopy = new Copies(1, DateTime.Now, 1);

            newCopy.Save();

            List <Copies> controlList = Copies.GetAll();
            List <Copies> testList    = new List <Copies> {
                newCopy
            };

            Assert.Equal(controlList, testList);
        }
示例#3
0
        public void Copies_Save_SaveCopiesToDatabase()
        {
            Copies newCopy = new Copies(10, 1);

            newCopy.Save();

            List <Copies> controlList = Copies.GetAll();

            Console.WriteLine(controlList[0].GetCopiesId());
            List <Copies> testList = new List <Copies> {
                newCopy
            };

            Console.WriteLine("copiestestline36", controlList[0]);

            Assert.Equal(controlList, testList);
            Console.WriteLine("copiestestline36", controlList[0]);
        }
        public void Copies_Delete_DeleteSingleCopy()
        {
            Patrons newPatrons = new Patrons("David", 1);

            newPatrons.Save();
            Books newBook = new Books("Of mice and men", 1);

            newBook.Save();
            Copies newCopies = new Copies(1, DateTime.Now, 1);

            newCopies.Save();

            newCopies.AddPatrons(newPatrons);

            newCopies.Delete();

            List <Copies> testCopies    = Copies.GetAll();
            List <Copies> controlCopies = new List <Copies> {
            };

            Assert.Equal(controlCopies, testCopies);
        }