Beispiel #1
0
 public void AddEventsTest()
 {
     repo = new DataRepository(new ContextFiller());
     Assert.AreEqual(false, repo.GetCopy(1).Borrowed);
     repo.AddBorrowingEvent(1, new DateTimeOffset(2019, 10, 19, 22, 0, 0, new TimeSpan(2, 0, 0)), new DateTimeOffset(2019, 10, 29, 22, 0, 0, new TimeSpan(2, 0, 0)), 1);
     Assert.AreEqual(5, repo.GetAllEvents().Count());
     repo.AddDestructionEvent(1, new DateTimeOffset(2019, 10, 19, 22, 0, 0, new TimeSpan(2, 0, 0)), "botak");
     Assert.AreEqual(6, repo.GetAllEvents().Count());
     repo.AddPurchaseEvent(1, new DateTimeOffset(2019, 10, 19, 22, 0, 0, new TimeSpan(2, 0, 0)), 200, "test");
     Assert.AreEqual(7, repo.GetAllEvents().Count());
     repo.AddReturnEvent(1, new DateTimeOffset(2019, 10, 19, 22, 0, 0, new TimeSpan(2, 0, 0)), 1, repo.GetAllEvents().OfType <BorrowingEvent>().FirstOrDefault());
     Assert.AreEqual(8, repo.GetAllEvents().Count());
 }