Example #1
0
        public void AddAndRemoveEventTest()
        {
            ICatalog catalog1 = new Catalog("Dune", "Frank Herbert");
            IState   state1   = new State(catalog1, 1);
            IUser    user1    = new User("John Smith");
            ICatalog catalog2 = new Catalog("Krol", "Szczepan Twardoch");
            IState   state2   = new State(catalog2, 2);
            IUser    user2    = new User("Michael Johnson");

            repository.AddBorrowEvent(state1, user1, new DateTime(2020, 11, 08, 12, 0, 0));
            repository.AddBorrowEvent(state2, user2, new DateTime(2020, 11, 08, 12, 1, 0));
            Assert.AreEqual(repository.GetEventsNumber(), 2);
            repository.RemoveEvent(repository.GetEvent(new DateTime(2020, 11, 08, 12, 0, 0), "John Smith"));
            repository.RemoveEvent(repository.GetEvent(new DateTime(2020, 11, 08, 12, 1, 0), "Michael Johnson"));
            Assert.AreEqual(repository.GetEventsNumber(), 0);
        }
Example #2
0
 public void Borrow(IState state, IUser user) => _repository.AddBorrowEvent(state, user, DateTime.Now);