Beispiel #1
0
        public void TestCheckForOwnerName()
        {
            //Arrange
            repo = new FakeRequestRepo();
            SeedRequestData();
            foreach (Request r in requests)
            {
                repo.AddRequest(r);
            }

            //Act
            bool stiles = repo.CheckForOwnerName("Stiles");
            bool robin  = repo.CheckForOwnerName("robinhood");

            //Assert
            Assert.True(stiles);
            Assert.False(robin);
        }
Beispiel #2
0
        public void TestAddRequest()
        {
            //Arrange
            repo = new FakeRequestRepo();
            SeedData();
            Request request = new Request()
            {
                Requester = users[0].UserName,
                Owner     = users[1].UserName,
                BookTitle = books[0].Title,
                Duration  = "1 week"
            };

            //Act
            repo.AddRequest(request);

            //Assert
            Assert.Single(repo.Requests);
            Assert.Equal("Stiles", repo.Requests.ElementAt(0).Owner);
            Assert.Equal("The Lightning Thief", repo.Requests.ElementAt(0).BookTitle);
        }