public StandardMoviePlayback(IMovie movie)
     : base(ResourceVolatility.Volatile)
 {
     Movie        = movie;
     reader       = movie.Read();
     videoSpeed   = 1.0;
     frameImage   = new MoviePlaybackImage();
     currentFrame = new MovieFrame
     {
         RgbaData  = new byte[GraphicsHelper.AlignedSize(reader.Width, reader.Height)],
         Timestamp = 0
     };
 }
        public async Task given_movie_not_found_then_FindScreening_returns_NotFoundResult(
            Guid movieId,
            Guid screeningId,
            IMovieReader readerStub,
            [NoAutoProperties] QueriesController sut)
        {
            var facade = new MovieReadModelFacade(readerStub);

            IActionResult actual = await
                                   sut.FindScreening(movieId, screeningId, facade);

            actual.Should().BeOfType <NotFoundResult>();
        }
Esempio n. 3
0
        public ReaderFactory(string fileType)
        {
            switch (fileType)
            {
            case "XML":
                _IMovieReader = new XMLMovieReader();
                break;

            case "JSON":
                _IMovieReader = new JSONMovieReader();
                break;

            // for any non-registered value _IMovieReader is null
            default: break;
            }
        }
Esempio n. 4
0
        static void Main(string[] args)
        {
            Console.SetWindowSize(60, 15);
            Console.WriteLine("Please, select the file type to read (1) XML, (2) JSON: ");
            var ans      = Console.ReadLine();
            var fileType = (ans == "1") ? "XML" : "JSON";

            _IMovieReader = new ReaderFactory(fileType)._IMovieReader;
            var typeSelected    = _IMovieReader.GetType().Name;
            var movieCollection = _IMovieReader.ReadMovies();

            Console.WriteLine($"Movie Titles ({typeSelected})");
            Console.WriteLine("------------");
            foreach (var movie in movieCollection.Take(10))
            {
                Console.WriteLine(movie.Title);
            }
            Console.ReadLine();
        }
Esempio n. 5
0
 public MovieReaderDecorator(IMovieReader movieReader)
 {
     this.movieReader = movieReader ?? throw new ArgumentNullException(nameof(movieReader));
 }
Esempio n. 6
0
 public MovieStopwatchDecorator(IMovieReader movieReader, ILogger <MovieStopwatchDecorator> logger)
     : base(movieReader)
 {
     this.logger = logger ?? throw new ArgumentNullException(nameof(logger));
     stopwatch   = new Stopwatch();
 }
 public MovieReadModelFacade(IMovieReader reader)
 => _reader = reader ?? throw new ArgumentNullException(nameof(reader));
Esempio n. 8
0
 public MovieController(IMovieReader movieReader, IMapper <IEnumerable <Movie>, IEnumerable <MovieListItemDTO> > mapperMovieListItem)
 {
     this.movieReader         = movieReader ?? throw new ArgumentNullException(nameof(movieReader));
     this.mapperMovieListItem = mapperMovieListItem ?? throw new ArgumentNullException(nameof(mapperMovieListItem));
 }