Example #1
0
        public void NrBestAvgPerfTest()
        {
            IMovieFunctions mr = new MovieFunctions
            {
                Reviews = reviews
            };

            Stopwatch sw = Stopwatch.StartNew();

            mr.BestMovies(10);
            sw.Stop();
            Assert.IsTrue(sw.ElapsedMilliseconds <= 4000);
        }
Example #2
0
        public void NrBestAvgTest()
        {
            IMovieFunctions mr = new MovieFunctions
            {
                Reviews = reviews
            };

            int g = 5;

            foreach (int i in mr.BestMovies(10))
            {
                Review r = reviews.FirstOrDefault(rev => rev.Movie == i);
                Assert.IsTrue(g >= r.Grade);
            }
        }