示例#1
0
        public void NrofRevsofUserTest()
        {
            IMovieFunctions mf = new MovieFunctions
            {
                Reviews = reviews
            };

            int res = mf.NrOfReviews(3);
            int exp = 2012;

            Assert.AreEqual(exp, res);
        }
示例#2
0
        public void NumberOfReviewsOfUserTestPerfTest()
        {
            IMovieFunctions mf = new MovieFunctions
            {
                Reviews = reviews
            };

            Random    rand  = new Random();
            Stopwatch timer = Stopwatch.StartNew();

            mf.NrOfReviews(rand.Next(1, 999));
            timer.Stop();

            Assert.IsTrue(timer.ElapsedMilliseconds < 4000);
        }