Пример #1
0
        public void Search_Should_Return_Empty_List_If_No_Matches()
        {
            var repo    = new RibbonRepository(_context);
            var results = repo.Search("foobarbazcatgrill", 1);

            Assert.NotNull(results);
            Assert.Empty(results);
        }
Пример #2
0
        public void Search_Should_Match_Only_User_Ribbon_Snag()
        {
            var repo    = new RibbonRepository(_context);
            var results = repo.Search("note 2", 1);

            Assert.Single(results);
            Assert.Equal("Test Video 3", results[0].Title);
        }
Пример #3
0
        public void Search_Should_Return_Empty_List_If_All_Whitespace()
        {
            var repo    = new RibbonRepository(_context);
            var results = repo.Search("     ", 1);

            Assert.NotNull(results);
            Assert.Empty(results);
        }
Пример #4
0
        public void Search_Should_Match_Only_User_Ribbon_Decription()
        {
            var repo    = new RibbonRepository(_context);
            var results = repo.Search("decription of", 2);

            Assert.Single(results);
            Assert.Equal("Test Video 4", results[0].Title);
        }
Пример #5
0
        public void Search_Should_Match_Only_User_Ribbon_Title()
        {
            var repo    = new RibbonRepository(_context);
            var results = repo.Search("Test", 1);

            Assert.Equal(2, results.Count);
            Assert.Equal("Test Video 4", results[0].Title);
            Assert.Equal("Test Video 3", results[1].Title);
        }
Пример #6
0
        public void User_Can_Delete_Ribbon_With_Snag()
        {
            var ribbonwithSnag = 1;
            var repo           = new RibbonRepository(_context);

            // Attempt to delete it
            repo.Delete(ribbonwithSnag);

            // Now attempt to get it
            var result = repo.GetById(ribbonwithSnag);

            Assert.Null(result);
        }