Ejemplo n.º 1
0
        public ListRestaurantsForm()
        {
            InitializeComponent();
            string _connectionString = "Data Source=" +
                                       Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData) + @"\OO_PocketGourmet_REAL-UnitTest\MVPDB.sqlite;";
            RestaurantServices restaurantServices = new RestaurantServices(new RestaurantRepository(_connectionString), new ModelDataAnnotationCheck());

            restaurantList = (List <RestaurantModel>)restaurantServices.GetAll();
            AddRestaurantList(restaurantList);
        }
Ejemplo n.º 2
0
        public void Reload()
        {
            restaurantPanel.Controls.Clear();
            string _connectionString = "Data Source=" +
                                       Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData) + @"\OO_PocketGourmet_REAL-UnitTest\MVPDB.sqlite;";
            RestaurantServices restaurantServices = new RestaurantServices(new RestaurantRepository(_connectionString), new ModelDataAnnotationCheck());

            restaurantList = (List <RestaurantModel>)restaurantServices.GetAll();
            AddRestaurantList(restaurantList);
        }
Ejemplo n.º 3
0
        public void ShouldReturnListOfRestaurants()
        {
            List <RestaurantModel> restaurantModelList = (List <RestaurantModel>)_restaurantServices.GetAll();

            Assert.NotEmpty(restaurantModelList);

            foreach (RestaurantModel rm in restaurantModelList)
            {
                _testOutputHelper.WriteLine($"Name:{rm.RestaurantName}\nAddress:{rm.RestaurantAddress}\n");
            }
        }