示例#1
0
        public void RestaurantInfoGetAverageRatingTest2()
        {
            string         expName     = "TGIFridays";
            string         expLocation = "4568 Main Street";
            double         expRating   = 2.5;
            RestaurantInfo testObj     = new RestaurantInfo(expName, expLocation);

            testObj.SubmitReview("Reviewer1", 4);
            testObj.SubmitReview("Reviewer1", 1, "Review Description");

            double actualVal = testObj.GetAverageRating;

            Assert.AreEqual(expName, testObj.Name);
            Assert.AreEqual(expLocation, testObj.Location);
            Assert.AreEqual(expRating, actualVal);
        }
示例#2
0
        public void GetAllReviewsTest2()
        {
            string         expName     = "Restaurant1";
            string         expLocation = "123 One St.";
            RestaurantInfo rest        = new RestaurantInfo(expName, expLocation);

            rest.SubmitReview("Reviewer1", 5);
            rest.SubmitReview("Reviewer2", 4);
            rest.SubmitReview("Reviewer3", 3);
            rest.SubmitReview("Reviewer4", 2);
            rest.SubmitReview("Reviewer5", 1);

            var l = rest.GetAllReviews();

            foreach (var review in l)
            {
                Assert.AreEqual(review.ReviewerName.Length, 9);
            }
            Assert.IsTrue(l.Count() == 05);
        }
示例#3
0
        public void SubmitReviewTest()
        {
            string         expReviewerName = "Hanzo Lastname";
            int            expRating       = 4;
            string         expDesc         = "";
            RestaurantInfo rest            = new RestaurantInfo("name", "loc");

            rest.SubmitReview(expReviewerName, expRating);

            Assert.IsTrue(rest.ReviewCount > 0);
        }