public void Add()
        {
            var libraryService = new LibraryService();
            Assert.AreEqual(true, libraryService.Add("1,ddddddd,0", out message));
            Assert.AreEqual(true, libraryService.Add("2,cccccc,1", out message));
            Assert.AreEqual(true, libraryService.Add("3,bbbbb,2", out message));
            Assert.AreEqual(true, libraryService.Add("4,aaaa,2", out message));
            Assert.AreEqual(4, libraryService.Count());

            Assert.AreEqual(false, libraryService.Add("1,ddddddd,0", out message));
            Assert.AreEqual("Id already exist, start again with different ID", message);
            Assert.AreEqual(true, libraryService.Add("5,ddddddd,0", out message));
            Assert.AreEqual("Added", message);
            Assert.AreEqual(false, libraryService.Add("6,Invalid Type,5", out message));
            Assert.AreEqual("Invalid Type", message);
        }
 public void AllItems()
 {
     var libraryService = new LibraryService();
     Assert.AreEqual(true, libraryService.Add("1,ddddddd,2", out message));
     Assert.AreEqual(true, libraryService.Add("2,bbbbb,2", out message));
     Assert.AreEqual(true, libraryService.Add("3,bbbbb,0", out message));
     Assert.AreEqual(true, libraryService.Add("4,aaaa,2", out message));
     Assert.AreEqual(4, libraryService.Count());
     Assert.AreEqual("Id already checked in, start again with different ID", libraryService.CheckIn("4"));
     Assert.AreEqual("Lent out", libraryService.Lent("4"));
     Assert.AreEqual("Checked In", libraryService.CheckIn("4"));
     Assert.AreEqual("Id not exists, start again with different ID", libraryService.CheckIn("5"));
     Assert.AreEqual(0, libraryService.LentOutItems().Count());
     Assert.AreEqual("Lent out", libraryService.Lent("1"));
     Assert.AreEqual(4, libraryService.AllItems().Count());
     Assert.AreEqual("3", libraryService.AllItems().FirstOrDefault().Id);
     Assert.AreEqual("4", libraryService.AllItems().ElementAt(1).Id);
 }
 public void CheckIn()
 {
     var libraryService = new LibraryService();
     Assert.AreEqual(true, libraryService.Add("1,ddddddd,0", out message));
     Assert.AreEqual(true, libraryService.Add("2,cccccc,1", out message));
     Assert.AreEqual(true, libraryService.Add("3,bbbbb,2", out message));
     Assert.AreEqual(true, libraryService.Add("4,aaaa,2", out message));
     Assert.AreEqual(4, libraryService.Count());
     Assert.AreEqual("Id already checked in, start again with different ID", libraryService.CheckIn("4"));
     Assert.AreEqual("Lent out", libraryService.Lent("4"));
     Assert.AreEqual("Checked In", libraryService.CheckIn("4"));
     Assert.AreEqual("Id not exists, start again with different ID", libraryService.CheckIn("5"));
 }