Esempio n. 1
0
        public void GetAllReviewsTest()
        {
            RestaurantsInfo infoObj             = new RestaurantsInfo();
            int             expectedReviewCount = 188;

            var actualReviews = infoObj.GetAllReviews();

            Assert.AreEqual(expectedReviewCount, actualReviews.Count());
        }
Esempio n. 2
0
        public void SearchRestaurantTest1()
        {
            RestaurantsInfo infoObj          = new RestaurantsInfo();
            string          expectedRestName = "Thiel LLC";
            int             expectedCount    = 1;

            var a = infoObj.SearchRestaurant("Thiel LLC");

            Assert.AreEqual(expectedCount, a.Count());
            Assert.AreEqual(expectedRestName, a.ElementAt(0).Name);
        }
Esempio n. 3
0
        public void RestaurantsInfoConstructorTest()
        {
            RestaurantsInfo infoObj             = new RestaurantsInfo();
            int             expected            = 51;
            int             expectedReviewCount = 7;// total = 188;

            var actual            = infoObj.ListOfRestaurants.Count();
            int actualReviewCount = infoObj.ListOfRestaurants.ElementAt(2).ReviewCount;

            Assert.AreEqual(expected, actual);
            Assert.AreEqual(expectedReviewCount, actualReviewCount);
        }
Esempio n. 4
0
        public void GetAllRestaurantsTest()
        {
            RestaurantsInfo infoObj = new RestaurantsInfo();
            int             expectedRestaurantCount = 51;

            var a = infoObj.GetAllRestaurants();

            Assert.AreEqual(expectedRestaurantCount, a.Count());
            foreach (var restaurant in a)
            {
                Assert.IsNotNull(restaurant.Name);
            }
        }
Esempio n. 5
0
        public void SearchRestaurantTest2()
        {
            string          restPartialName   = "Jo";
            RestaurantsInfo infoObj           = new RestaurantsInfo();
            string          expectedRestName1 = "Jones Group";
            string          expectedRestName2 = "Johns Group";
            string          expectedRestName3 = "Jones LLC";
            int             expectedCount     = 3;

            var a = infoObj.SearchRestaurant(restPartialName);

            Assert.AreEqual(expectedCount, a.Count());
            Assert.AreEqual(expectedRestName1, a.ElementAt(0).Name);
            Assert.AreEqual(expectedRestName2, a.ElementAt(1).Name);
            Assert.AreEqual(expectedRestName3, a.ElementAt(2).Name);
        }
Esempio n. 6
0
        public void GetTopRestaurantsTest()
        {
            // Dummy Data: Franklin BBQ, Pizza Place (Tallahassee), Checkers
            RestaurantsInfo infoObj        = new RestaurantsInfo();
            string          first          = "Rath, Stehr and O'Connell";
            string          second         = "Schiller LLC";
            string          secondLocation = "Old Shore";
            string          third          = "Collier, Beatty and Mertz";

            var a = infoObj.GetTopRestaurants(3);

            Assert.AreEqual(first, a.ElementAt(0).Name);
            Assert.AreEqual(second, a.ElementAt(1).Name);
            Assert.AreEqual(secondLocation, a.ElementAt(1).Location);
            Assert.AreEqual(third, a.ElementAt(2).Name);
        }
Esempio n. 7
0
        static void Main(string[] args)
        {
            string inputString = "";

            rinfo      = new RestaurantsInfo();
            logHandler = LogManager.GetLogger("f");

            while (inputString != "quit")
            {
                PrintCommands();

                inputString = Console.ReadLine();
                Console.Clear();

                //DisplayTop3();

                logHandler.Info(inputString);
                InputHandler.DetermineCommand(inputString);
                //Console.WriteLine();
            }
        }