コード例 #1
0
        public void GetFilterMovies()
        {
            Movie movieFilter = new Movie()
            {
                Name = "La Era de Hielo"
            };

            mock.Setup(x => x.GetMovies(It.IsAny <Predicate <Movie> >())).Returns(movies);
            service.GetMovies(movieFilter);
            mock.VerifyAll();
        }
コード例 #2
0
 private void InitData()
 {
     moviesService.GetMovies(dataGridViewMovies);
     SetDataGridViewColumnsWidth(dataGridViewMovies);
     comboBoxGenre.DataSource    = genreService.GetGenres();
     comboBoxGenre.ValueMember   = "Genre_ID";
     comboBoxGenre.DisplayMember = "Name";
     comboBoxCategory.Items.Add("3");
     comboBoxCategory.Items.Add("12");
     comboBoxCategory.Items.Add("16");
     comboBoxCategory.Items.Add("18");
     textBoxID.Enabled = false;
     VisibleButtons(false);
     buttonAdd.Visible = true;
     ClearInput();
 }
コード例 #3
0
 private void buttonShowMovies_Click(object sender, EventArgs e)
 {
     dataGridViewData.DataSource = null;
     moviesService.GetMovies(dataGridViewData);
     SetDataGridViewColumnsWidthMovies(dataGridViewData);
     showtimes = false;
     EnableGroupBox();
     ClearInput();
 }
コード例 #4
0
ファイル: HomeController.cs プロジェクト: piotr121993/swapi
        public async Task <IActionResult> Index()
        {
            var movieList = await MoviesService.GetMovies();

            var viewModel = new MoviesViewModel
            {
                Movies = movieList.Results
            };

            return(View(viewModel));
        }
コード例 #5
0
        public void get_movies_when_response_from_remote_server_successfull()
        {
            //Arrange
            MoviesService moviesService = new MoviesService();

            //Act
            var actual = moviesService.GetMovies();

            //Assert
            Assert.IsNotNull(actual);
            Assert.IsTrue(actual.ToList().Any());
        }
コード例 #6
0
        public void get_movies_when_response_from_remote_server_not_successfull()
        {
            //Arrange
            MoviesService moviesService = new MoviesService();

            //Act
            var actual = moviesService.GetMovies();

            //Assert
            Assert.IsNotNull(actual);
            //TODO:When this senario(get response when remote server not available/bad response) is implemented only this assertion can be executed.
            // Assert.IsTrue(!actual.ToList().Any());
        }
コード例 #7
0
 public ActionResult <string> GetMovies(string id)
 {
     return(MoviesService.GetMovies(id));
 }
コード例 #8
0
 private async Task BindMovies()
 {
     Movies = await MoviesService.GetMovies();
 }