コード例 #1
0
        public async Task GetMovie()
        {
            try
            {
                await _context.GetContext();

                var controller = new FilmworldController(_context.Context, MockHelper.MockLogger <FilmworldController>());

                var result = await controller.GetMovie("");

                result.Should().BeOfType <OkObjectResult>();
            }
            finally
            {
                _context.Close();
            }
        }
コード例 #2
0
        public async Task GetMovies()
        {
            try
            {
                await _context.GetContext();

                var controller = new FilmworldController(_context.Context, MockHelper.MockLogger <FilmworldController>());
                var request    = new MovieRequest {
                    Page = 2, PageSize = 5
                };

                var result = await controller.GetMovies(request);

                result.Should().BeOfType <OkObjectResult>();
            }
            finally
            {
                _context.Close();
            }
        }