Exemplo n.º 1
0
        public void TestNotRankingQuoteWirdGerankt()
        {
            var controller = new QuoteController();
            // Zuerst wird Zitat gefunden.

            FormCollection collection = new FormCollection();

            collection["NotRakingUserList"]    = "*****@*****.**";
            collection["NotRakingLanguage"]    = "";
            collection["NotRakingMediumTitle"] = "";

            var resultFiltern  = controller.FilternQuotes(collection) as PartialViewResult;
            var produktFiltern = (IQueryable <Quote>)resultFiltern.ViewData.Model;

            int quoteId = (int)produktFiltern.Single().Id;

            //Und wird diese Zitat gerankt.

            collection["RankenWert"]  = "3";
            collection["Rolle"]       = "The Terminator";
            collection["Language"]    = QuoteLanguageEnum.English.ToString();
            collection["QuoteString"] = "DummyQuote";
            var resultRanken  = controller.ZitatRanken(quoteId, collection, fakeAdmin) as ViewResult;
            var produktRanken = (IQueryable <Quote>)resultRanken.ViewData.Model;

            // Jetzt gibt es in der DB 4 Zitate die noch niht gerankt sind.

            var result  = controller.ShowNotRankingZitate() as ViewResult;
            var produkt = (IQueryable <Quote>)result.ViewData.Model;


            Assert.AreEqual(produkt.Count(), 4);
        }
Exemplo n.º 2
0
        public void TestWithUserNameFiltern()
        {
            var controller = new QuoteController();

            FormCollection collection = new FormCollection();

            collection["NotRakingUserList"]    = "*****@*****.**";
            collection["NotRakingLanguage"]    = "";
            collection["NotRakingMediumTitle"] = "";

            var result  = controller.FilternQuotes(collection) as PartialViewResult;
            var produkt = (IQueryable <Quote>)result.ViewData.Model;


            Assert.AreEqual(produkt.Count(), 2);
        }
Exemplo n.º 3
0
        public void TestWithSpracheFiltern()
        {
            var controller = new QuoteController();

            FormCollection collection = new FormCollection();

            collection["NotRakingUserList"]    = "";
            collection["NotRakingLanguage"]    = Models.QuoteLanguageEnum.English.ToString();
            collection["NotRakingMediumTitle"] = "";

            var result  = controller.FilternQuotes(collection) as PartialViewResult;
            var produkt = (IQueryable <Quote>)result.ViewData.Model;


            Assert.AreEqual(produkt.Count(), 5);
        }