public ImportXMLCommand(IBookService bookService, IGenreService genreService, IProducerService producerService, IStudioService studioService, IXMLParser xmlParser)
        {
            if (bookService == null)
            {
                throw new ArgumentNullException("Book service cannnot be null.");
            }

            if (genreService == null)
            {
                throw new ArgumentNullException("Genre service cannnot be null.");
            }

            if (producerService == null)
            {
                throw new ArgumentNullException("Studio service cannnot be null.");
            }

            if (studioService == null)
            {
                throw new ArgumentNullException("Studio service cannnot be null.");
            }

            if (xmlParser == null)
            {
                throw new ArgumentNullException("XML parser cannnot be null.");
            }

            this.bookService     = bookService;
            this.genreService    = genreService;
            this.producerService = producerService;
            this.studioService   = studioService;
            this.xMLParser       = xmlParser;
        }
        public DeleteCommand(IBookService bookService, IMovieService movieService, IStarService starService, IStudioService studioService)
        {
            if (bookService == null)
            {
                throw new ArgumentNullException("Book service cannot be null.");
            }

            if (movieService == null)
            {
                throw new ArgumentNullException("Movie service cannot be null.");
            }

            if (starService == null)
            {
                throw new ArgumentNullException("Star service cannot be null.");
            }

            if (studioService == null)
            {
                throw new ArgumentNullException("Studio service cannot be null.");
            }

            this.bookService   = bookService;
            this.movieService  = movieService;
            this.starService   = starService;
            this.studioService = studioService;
        }
Beispiel #3
0
        public PackageDetailsViewModel(IWizardModel wizardModel, IPackageService packageService,
                                       IDialogService folderService, IStudioService studioService, string projectsXmlFilePath, IEventAggregatorService eventAggregator, object view) : base(view)
        {
            _wizardModel      = wizardModel;
            CurrentPageNumber = 1;
            _displayName      = PluginResources.Wizard_PackageDetails_DisplayName;
            _tooltip          = PluginResources.Wizard_PackageDetails_Tooltip;
            IsPreviousEnabled = false;
            IsNextEnabled     = true;
            CanCancel         = true;
            _isValid          = false;
            _dialogService    = folderService;
            _studioService    = studioService;
            PackageModel      = new AsyncTaskWatcherService <PackageModel>(
                packageService.OpenPackage(_wizardModel.TransitFilePathLocation, _wizardModel.PathToTempFolder));
            Customers               = new AsyncTaskWatcherService <List <Customer> >(_studioService.GetCustomers(projectsXmlFilePath));
            ProjectTemplates        = new ObservableCollection <ProjectTemplateInfo>(_studioService.GetProjectTemplates());
            SelectedProjectTemplate = ProjectTemplates[0];
            DueDate           = null;
            _displayStartDate = DateTime.Now;
            _errorMessage     = string.Empty;
            PropertyChanged  += PackageDetailsViewModelChanged;

            _errorMessageEvent = eventAggregator.Subscribe <Error>(OnErrorOccured);
        }
Beispiel #4
0
 public RoomsController(
     IRoomService roomService,
     IStudioService studioService)
 {
     _roomService   = roomService;
     _studioService = studioService;
 }
        public virtual async void TestDelete()
        {
            var builder = new WebHostBuilder()
                          .UseEnvironment("Production")
                          .UseStartup <TestStartup>();
            TestServer testServer = new TestServer(builder);
            var        client     = new ApiClient(testServer.CreateClient());

            client.SetBearerToken(JWTTestHelper.GenerateBearerToken());
            ApplicationDbContext context = testServer.Host.Services.GetService(typeof(ApplicationDbContext)) as ApplicationDbContext;

            IStudioService service = testServer.Host.Services.GetService(typeof(IStudioService)) as IStudioService;
            var            model   = new ApiStudioServerRequestModel();

            model.SetProperties("B", "B", "B", "B", "B", "B", "B");
            CreateResponse <ApiStudioServerResponseModel> createdResponse = await service.Create(model);

            createdResponse.Success.Should().BeTrue();

            ActionResponse deleteResult = await client.StudioDeleteAsync(2);

            deleteResult.Success.Should().BeTrue();
            ApiStudioServerResponseModel verifyResponse = await service.Get(2);

            verifyResponse.Should().BeNull();
        }
        public MovieService(
            IRepository <Movie> movieRepository,
            IUnitOfWork unitOfWork,
            IMovieFactory movieFactory,
            IProducerService producerService,
            IStudioService studioService,
            IGenreService genreService,
            IBookService bookService,
            IStarService starService)
        {
            if (movieRepository == null)
            {
                throw new ArgumentNullException("Movie repository cannot be null!");
            }

            if (unitOfWork == null)
            {
                throw new ArgumentNullException("Unit of work cannot be null!");
            }

            if (movieFactory == null)
            {
                throw new ArgumentNullException("Movie factory cannot be null!");
            }

            if (producerService == null)
            {
                throw new ArgumentNullException("Producer service cannot be null!");
            }

            if (studioService == null)
            {
                throw new ArgumentNullException("Studio service cannot be null!");
            }

            if (genreService == null)
            {
                throw new ArgumentNullException("Genre service cannot be null!");
            }

            if (bookService == null)
            {
                throw new ArgumentNullException("Book service cannot be null!");
            }

            if (starService == null)
            {
                throw new ArgumentNullException("Star service cannot be null!");
            }

            this.movieRepository = movieRepository;
            this.unitOfWork      = unitOfWork;
            this.movieFactory    = movieFactory;
            this.producerService = producerService;
            this.studioService   = studioService;
            this.genreService    = genreService;
            this.bookService     = bookService;
            this.starService     = starService;
        }
        public StudioController()
        {
            var dbFactory = new DatabaseFactory();

            studioRepository = new Repository <Domain.Studio>(dbFactory);
            unitofWork       = new UnitofWork(dbFactory);
            studioService    = new StudioService(dbFactory);
        }
 public AbstractStudioController(
     ApiSettings settings,
     ILogger <AbstractStudioController> logger,
     ITransactionCoordinator transactionCoordinator,
     IStudioService studioService,
     IApiStudioModelMapper studioModelMapper
     )
     : base(settings, logger, transactionCoordinator)
 {
     this.StudioService     = studioService;
     this.StudioModelMapper = studioModelMapper;
 }
Beispiel #9
0
        public StudioServiceTests()
        {
            _studioValidator      = new Mock <IStudioValidator>();
            _studioRepository     = new Mock <IStudioRepository>();
            _postalCodeRepository = new Mock <IPostalCodeRepository>();
            _userRepository       = new Mock <IUserRepository>();
            _userPasswordService  = new Mock <IUserPasswordService>();
            _mapper = new Mock <IMapper>();

            _studioService = new StudioService(
                _studioValidator.Object,
                _studioRepository.Object,
                _postalCodeRepository.Object,
                _userRepository.Object,
                _mapper.Object);

            _userValidator = new Mock <IUserValidator>();

            _mapper
            .Setup(x => x.Map <StudioDto>(It.IsAny <Studio>()))
            .Returns((Studio source) =>
            {
                var rooms = new List <RoomDto>();
                foreach (var room in source.Rooms)
                {
                    rooms.Add(_mapper.Object.Map <RoomDto>(room));
                }

                return(new StudioDto
                {
                    Id = source.Id,
                    Name = source.Name,
                    FriendlyUrl = source.FriendlyUrl,
                    Rooms = rooms,
                    OwnerUserId = source.OwnerUserId,
                    PostalCode = source.PostalCode
                });
            });

            _mapper
            .Setup(x => x.Map <RoomDto>(It.IsAny <Room>()))
            .Returns((Room source) =>
            {
                return(new RoomDto
                {
                    Id = source.Id,
                    StudioId = source.StudioId,
                    Name = source.Name
                });
            });
        }
Beispiel #10
0
 public StudioController(
     ApiSettings settings,
     ILogger <StudioController> logger,
     ITransactionCoordinator transactionCoordinator,
     IStudioService studioService,
     IApiStudioServerModelMapper studioModelMapper
     )
     : base(settings, logger, transactionCoordinator)
 {
     this.StudioService     = studioService;
     this.StudioModelMapper = studioModelMapper;
     this.BulkInsertLimit   = 250;
     this.MaxLimit          = 1000;
     this.DefaultLimit      = 250;
 }
        public virtual async void TestUpdate()
        {
            var builder = new WebHostBuilder()
                          .UseEnvironment("Production")
                          .UseStartup <TestStartup>();
            TestServer testServer = new TestServer(builder);

            var client = new ApiClient(testServer.CreateClient());

            client.SetBearerToken(JWTTestHelper.GenerateBearerToken());
            var mapper = new ApiStudioServerModelMapper();
            ApplicationDbContext         context = testServer.Host.Services.GetService(typeof(ApplicationDbContext)) as ApplicationDbContext;
            IStudioService               service = testServer.Host.Services.GetService(typeof(IStudioService)) as IStudioService;
            ApiStudioServerResponseModel model   = await service.Get(1);

            ApiStudioClientRequestModel request = mapper.MapServerResponseToClientRequest(model);

            request.SetProperties("B", "B", "B", "B", "B", "B", "B");

            UpdateResponse <ApiStudioClientResponseModel> updateResponse = await client.StudioUpdateAsync(model.Id, request);

            context.Entry(context.Set <Studio>().ToList()[0]).Reload();
            updateResponse.Record.Should().NotBeNull();
            updateResponse.Success.Should().BeTrue();
            updateResponse.Record.Id.Should().Be(1);
            context.Set <Studio>().ToList()[0].Address1.Should().Be("B");
            context.Set <Studio>().ToList()[0].Address2.Should().Be("B");
            context.Set <Studio>().ToList()[0].City.Should().Be("B");
            context.Set <Studio>().ToList()[0].Name.Should().Be("B");
            context.Set <Studio>().ToList()[0].Province.Should().Be("B");
            context.Set <Studio>().ToList()[0].Website.Should().Be("B");
            context.Set <Studio>().ToList()[0].Zip.Should().Be("B");

            updateResponse.Record.Id.Should().Be(1);
            updateResponse.Record.Address1.Should().Be("B");
            updateResponse.Record.Address2.Should().Be("B");
            updateResponse.Record.City.Should().Be("B");
            updateResponse.Record.Name.Should().Be("B");
            updateResponse.Record.Province.Should().Be("B");
            updateResponse.Record.Website.Should().Be("B");
            updateResponse.Record.Zip.Should().Be("B");
        }
 public SysAdminController(IStudioActiveService studioActiveService, IStudioService studioService, IEncrypt encrypt)
 {
     _studioActiveService = studioActiveService;
     _studioService       = studioService;
     _encrypt             = encrypt;
 }
Beispiel #13
0
 public StudiosController(IStudioService studioService)
 {
     _studioService = studioService;
 }
 public HomeController(IStudioService serv)
 {
     studioService = serv;
 }
Beispiel #15
0
 public StudioController(IStudioService studioService, ILogger <StudioController> logger)
 {
     _studioService = studioService;
     _logger        = logger;
 }
 public StudiosActorsByMovieModel(IMovieService mservice, IActorService aservice, IStudioService sservice)
 {
     movieService  = mservice;
     actorService  = aservice;
     studioService = sservice;
 }
Beispiel #17
0
 public GetStudiosModel(IStudioService service)
 {
     studioService = service;
 }
 public StudioController(IStudioService service)
 {
     this.studioService = service;
 }
 public MovieController(IMovieService movieService, IStudioService studioService, ILogger <MovieController> logger)
 {
     _movieService  = movieService;
     _studioService = studioService;
     _logger        = logger;
 }
Beispiel #20
0
 public CreateModel(IStudioService service)
 {
     this.studioService = service;
 }
Beispiel #21
0
        public StudioServiceUnitTests()
        {
            var projectsController = Substitute.For <ProjectsController>();

            _studioService = new StudioService(projectsController);
        }