Ejemplo n.º 1
0
 public ParkingService(DataContext context, IGarageService garageService, ISpaceService spaceService, IUserService userService)
 {
     _context       = context;
     _userService   = userService;
     _spaceService  = spaceService;
     _garageService = garageService;
 }
Ejemplo n.º 2
0
        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;

            ISpaceService service = testServer.Host.Services.GetService(typeof(ISpaceService)) as ISpaceService;
            var           model   = new ApiSpaceServerRequestModel();

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

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

            ActionResponse deleteResult = await client.SpaceDeleteAsync(2);

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

            verifyResponse.Should().BeNull();
        }
 public GetSpacesCommand(
     ILayoutRepository layoutRepository,
     ISpaceService spaceService)
 {
     _layoutRepository = layoutRepository;
     _spaceService     = spaceService;
 }
Ejemplo n.º 4
0
 public SharedSpaceService(IUnitOfWork unitOfWork, ILogger logger, IUsersService userService, ISpaceService spaceService)
 {
     _unitOfWork   = unitOfWork;
     _logger       = logger;
     _userService  = userService;
     _spaceService = spaceService;
 }
Ejemplo n.º 5
0
        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 ApiSpaceServerModelMapper();
            ApplicationDbContext        context = testServer.Host.Services.GetService(typeof(ApplicationDbContext)) as ApplicationDbContext;
            ISpaceService               service = testServer.Host.Services.GetService(typeof(ISpaceService)) as ISpaceService;
            ApiSpaceServerResponseModel model   = await service.Get(1);

            ApiSpaceClientRequestModel request = mapper.MapServerResponseToClientRequest(model);

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

            UpdateResponse <ApiSpaceClientResponseModel> updateResponse = await client.SpaceUpdateAsync(model.Id, request);

            context.Entry(context.Set <Space>().ToList()[0]).Reload();
            updateResponse.Record.Should().NotBeNull();
            updateResponse.Success.Should().BeTrue();
            updateResponse.Record.Id.Should().Be(1);
            context.Set <Space>().ToList()[0].Description.Should().Be("B");
            context.Set <Space>().ToList()[0].Name.Should().Be("B");

            updateResponse.Record.Id.Should().Be(1);
            updateResponse.Record.Description.Should().Be("B");
            updateResponse.Record.Name.Should().Be("B");
        }
Ejemplo n.º 6
0
 public GameContext(IHeroService heroService, IInputService inputService, ITimeService timeService, ISpaceService spaceService, IRandomService randomService)
 {
     HeroService   = heroService;
     InputService  = inputService;
     TimeService   = timeService;
     SpaceService  = spaceService;
     RandomService = randomService;
 }
Ejemplo n.º 7
0
        public GitHubApiController(ISpaceService spaceService, IGitHubService gitHubService)
        {
            Contract.Requires(spaceService != null);
            Contract.Requires(gitHubService != null);

            _spaceService  = spaceService;
            _gitHubService = gitHubService;
        }
Ejemplo n.º 8
0
 public SpacesController(
     ISpaceService spaceService,
     IMapper mapper,
     IOptions <AppSettings> appSettings)
 {
     _spaceService = spaceService;
     _mapper       = mapper;
     _appSettings  = appSettings.Value;
 }
Ejemplo n.º 9
0
 public AbstractSpaceController(
     ApiSettings settings,
     ILogger <AbstractSpaceController> logger,
     ITransactionCoordinator transactionCoordinator,
     ISpaceService spaceService,
     IApiSpaceModelMapper spaceModelMapper
     )
     : base(settings, logger, transactionCoordinator)
 {
     this.SpaceService     = spaceService;
     this.SpaceModelMapper = spaceModelMapper;
 }
Ejemplo n.º 10
0
 public SpaceController(
     ApiSettings settings,
     ILogger <SpaceController> logger,
     ITransactionCoordinator transactionCoordinator,
     ISpaceService spaceService,
     IApiSpaceServerModelMapper spaceModelMapper
     )
     : base(settings, logger, transactionCoordinator)
 {
     this.SpaceService     = spaceService;
     this.SpaceModelMapper = spaceModelMapper;
     this.BulkInsertLimit  = 250;
     this.MaxLimit         = 1000;
     this.DefaultLimit     = 250;
 }
Ejemplo n.º 11
0
        /// <summary>
        /// Initializes a new instance of the MainViewModel class.
        /// </summary>
        public SpaceListViewModel(ConfluenceToolWindowNavigatorViewModel parent)
        {
            this._spaceService = new SpaceService();

            this._parent   = parent;
            this.SpaceList = new ObservableCollection <Space>();

            this.SpaceSelectedCommand = new DelegateCommand(OnItemSelected);
            OleMenuCommandService service = ConfluencePackage.Mcs;

            InitializeCommands(service);

            GetSpacesAsync();

            this.SpaceList.CollectionChanged += this.OnCollectionChanged;
        }
 public SubscriptionDeleteCommandHandler(ISpaceService spaceService, ISubscriptionService subService)
 {
     this.spaceService = spaceService;
     this.subService   = subService;
 }
 /// <summary>
 ///
 /// </summary>
 /// <param name="spaceService"></param>
 /// <param name="logger"></param>
 public SpaceController(ISpaceService spaceService)
 {
     _spaceService = spaceService;
 }
 public SpaceUpdateCommandHandler(ISpaceService service)
 {
     this.service = service;
 }
Ejemplo n.º 15
0
 public PostAlterCommandPolicy(IPostService postService, ISpaceService spaceService, IRoleService roleService)
 {
     this.postService  = postService;
     this.spaceService = spaceService;
     this.roleService  = roleService;
 }
Ejemplo n.º 16
0
 public SpaceController(ISpaceService repository)
 {
     this.repo = repository;
 }
Ejemplo n.º 17
0
 public PostCreateCommandHandler(ISpaceService spaceService, IPostService postService)
 {
     this.spaceService = spaceService;
     this.postService  = postService;
 }
Ejemplo n.º 18
0
 public SpaceController(ISpaceService spaceService, IAssetService assetService)
 {
     _spaceService = spaceService;
     _assetService = assetService;
 }
Ejemplo n.º 19
0
 public CommentAlterCommandPolicy(ICommentService commentService, ISpaceService spaceService, IRoleService roleService)
 {
     this.commentService = commentService;
     this.spaceService   = spaceService;
     this.roleService    = roleService;
 }