Exemplo n.º 1
0
        private static Production GetTrimmedProduction(Production production)
        {
            ProductionFactory productionFactory = new ProductionFactory();
            Production        trimmedProduction = productionFactory.Build(production.ProductionType);

            trimmedProduction.ID             = production.ID;
            trimmedProduction.IMDbID         = production.IMDbID;
            trimmedProduction.Title          = production.Title;
            trimmedProduction.Year           = production.Year;
            trimmedProduction.ProductionType = production.ProductionType;

            if (trimmedProduction is Movie)
            {
                Movie movie        = production as Movie;
                Movie trimmedMovie = trimmedProduction as Movie;
                trimmedMovie.Budget           = movie.Budget;
                trimmedMovie.FilmingLocations = movie.FilmingLocations;
                trimmedMovie.OriginalTitle    = movie.OriginalTitle;
                trimmedMovie.PlotSummary      = movie.PlotSummary;
                trimmedMovie.Runtime          = movie.Runtime;
                trimmedMovie.StoryLine        = movie.StoryLine;
                trimmedMovie.TagLines         = movie.TagLines;
            }

            if (trimmedProduction is TVSeries)
            {
                TVSeries tvSeries        = production as TVSeries;
                TVSeries trimmedTVSeries = trimmedProduction as TVSeries;
                trimmedTVSeries.EndYear = tvSeries.EndYear;
            }

            return(trimmedProduction);
        }
Exemplo n.º 2
0
        public MapIternary(ProductionFactory factory, IEnumerable <IStop> stops)
        {
            _stops.Enqueue(factory);

            foreach (var stop in stops)
            {
                _stops.Enqueue(stop);
            }
        }
Exemplo n.º 3
0
        public static Car CreateCar(ManufacturerEnum manufacturer)
        {
            var production = ProductionFactory.CreateProduction(manufacturer);

            return(new Car
            {
                Door = production.Door,
                Engine = production.Engine,
                Manufacturer = manufacturer.ToString(),
                Model = production.Model,
                Tires = production.Tires
            });
        }
Exemplo n.º 4
0
        public TransportMap AddFactory(ProductionFactory factory, Truck[] trucks)
        {
            if (factory is null)
            {
                throw new ArgumentNullException(nameof(factory));
            }

            _factory = factory;

            _factory.AddVehicle(trucks);
            _vehicles.AddRange(trucks);

            return(this);
        }
Exemplo n.º 5
0
        public void ProductionConfig()
        {
            // Arrange
            var factory = new ProductionFactory();

            // Act
            Startup startup      = new Startup(factory);
            var     atcualContex = startup.Run();

            // Assert
            var expectedContext = new Context
            {
                connectionAttributes = "Аттрибуты для работы с облаком",
                connectionString     = "https:/Postgres/CloudBase"
            };

            Assert.Equal(expectedContext, atcualContex);
        }