Exemplo n.º 1
0
 public GViewController(
     IApiWorkContext workContext,
     IStationService stationService,
     IRoomService roomService,
     IFsuService fsuService,
     IDeviceService deviceService,
     IPointService pointService,
     ISignalService signalService,
     IAMeasureService ameasureService,
     IGImageService gimageService,
     IGPageService gpageService,
     IGTemplateService gtemplateService,
     IGroupService groupService,
     IPackMgr packMgr)
 {
     this._workContext      = workContext;
     this._stationService   = stationService;
     this._roomService      = roomService;
     this._fsuService       = fsuService;
     this._deviceService    = deviceService;
     this._pointService     = pointService;
     this._signalService    = signalService;
     this._ameasureService  = ameasureService;
     this._gimageService    = gimageService;
     this._gpageService     = gpageService;
     this._gtemplateService = gtemplateService;
     this._groupService     = groupService;
     this._packMgr          = packMgr;
 }
Exemplo n.º 2
0
        public void SetUp()
        {
            dbContext    = DbContextUtility.CreateMockDb();
            pointService = Substitute.For <IPointService>();

            testObj = new LeagueService(dbContext, pointService);
        }
Exemplo n.º 3
0
 public PointsController(
     IPointService pointService,
     IMapper mapper,
     IOptions <AppSettings> appSettings) : base(mapper, appSettings)
 {
     _pointService = pointService;
 }
Exemplo n.º 4
0
 public PointServiceSource(
     TimeSpan pointTtl,
     IPointService pointGeneratingService)
 {
     this.pointTtl = pointTtl;
     this.pointGeneratingService = pointGeneratingService;
 }
Exemplo n.º 5
0
 public CreateConnectionHandler(IBusClient busClient,
                                IPointService pointService, ILogger <CreateConnectionHandler> logger)
 {
     _busClient    = busClient ?? throw new ArgumentNullException(nameof(busClient));
     _pointService = pointService ?? throw new ArgumentNullException(nameof(pointService));
     _logger       = logger ?? throw new ArgumentNullException(nameof(logger));
 }
Exemplo n.º 6
0
 public PointServiceSource(
     TimeSpan pointTtl,
     IPointService pointGeneratingService)
 {
     this.pointTtl = pointTtl;
     this.pointGeneratingService = pointGeneratingService;
 }
Exemplo n.º 7
0
        public void Points_UpdatePoints_PlayerB_WinsTheGame()
        {
            ServiceProvider serviceProvider = ServiceHelper.RegisterServices();
            IPointService   pointService    = serviceProvider.GetService <IPointService>();
            Player          playerA         = new Player("Player A");
            Player          playerB         = new Player("Player B");

            pointService.UpdatePlayerPoints(playerA, playerB, playerA.Name);
            Assert.AreEqual(Points.Fifteen, playerA.Points);

            pointService.UpdatePlayerPoints(playerA, playerB, playerB.Name);
            Assert.AreEqual(Points.Fifteen, playerB.Points);

            pointService.UpdatePlayerPoints(playerA, playerB, playerA.Name);
            Assert.AreEqual(Points.Thirty, playerA.Points);

            pointService.UpdatePlayerPoints(playerA, playerB, playerB.Name);
            Assert.AreEqual(Points.Thirty, playerB.Points);

            pointService.UpdatePlayerPoints(playerA, playerB, playerB.Name);
            Assert.AreEqual(Points.Forty, playerB.Points);

            pointService.UpdatePlayerPoints(playerA, playerB, playerB.Name);
            Assert.AreEqual(Points.Game, playerB.Points);
            Assert.AreEqual(Points.Thirty, playerA.Points);
        }
Exemplo n.º 8
0
 public PointController(IPointService service, IEdgeService edgeService, IMainAlgoritmService algoritmService, IMapper mapper)
 {
     this.pointService    = service;
     this.edgeService     = edgeService;
     this.algoritmService = algoritmService;
     this.mapper          = mapper;
 }
Exemplo n.º 9
0
 public HomeController(IMarkerService markerService, IMarkerIconService markerIconService, IRouteLegService routeLegService,
                       IPointService pointService)
 {
     this.markerService     = markerService;
     this.markerIconService = markerIconService;
     this.routeLegService   = routeLegService;
     this.pointService      = pointService;
 }
Exemplo n.º 10
0
 public PointServiceSource(
     TimeSpan pointTtl,
     IPointService pointGeneratingService)
 {
     this.pointTtl = pointTtl;
     this.pointGeneratingService = pointGeneratingService;
     this.kalmanFilter           = new KalmanFilter();
 }
Exemplo n.º 11
0
 public CreatePointHandler(IBusClient busClient,
                           IPointService pointService,
                           ILogger <CreatePointHandler> logger)
 {
     _busClient    = busClient;
     _pointService = pointService;
     _logger       = logger;
 }
Exemplo n.º 12
0
        private void BindData()
        {
            IPointService service = ServicesFactory.CreatePointService();

            string data = Newtonsoft.Json.JsonConvert.SerializeObject(service.GetListOfPoints(_ageFilters, _genderFilters));

            string myScriptValue = "markers=" + data;

            ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "myScriptName", myScriptValue, true);
        }
Exemplo n.º 13
0
 public CustomerDataService(IPointService pointService, IUserService userService, ILikeService likeService, ICustomerRepository customerRepository, IOutSiteCustomerRepository outSiteCustomerRepository, IVerifyCodeRepository verifyCodeRepository, IResourceService resourceService)
 {
     _likeService               = likeService;
     _customerRepository        = customerRepository;
     _outSiteCustomerRepository = outSiteCustomerRepository;
     _verifyCodeRepository      = verifyCodeRepository;
     _resourceService           = resourceService;
     _userService               = userService;
     _pointService              = pointService;
 }
Exemplo n.º 14
0
 public void GameManager_PointServiceNull()
 {
     ServiceProvider serviceProvider = ServiceHelper.RegisterServices();
     // Get service provider
     IConsoleService consoleService = serviceProvider.GetService <IConsoleService>();
     IPlayerService  playerService  = serviceProvider.GetService <IPlayerService>();
     IPointService   pointService   = null;
     //Play tennis game
     GameManager game = new GameManager(consoleService, playerService, pointService);
 }
Exemplo n.º 15
0
 public CustomerDataService(IPointService pointService, IUserService userService, ILikeService likeService, ICustomerRepository customerRepository, IOutSiteCustomerRepository outSiteCustomerRepository, IVerifyCodeRepository verifyCodeRepository, IResourceService resourceService)
 {
     _likeService = likeService;
     _customerRepository = customerRepository;
     _outSiteCustomerRepository = outSiteCustomerRepository;
     _verifyCodeRepository = verifyCodeRepository;
     _resourceService = resourceService;
     _userService = userService;
     _pointService = pointService;
 }
 public PointinatingController(
     ICardService cardService,
     ITeamService teamService,
     ISecurityService securityService,
     IPointService pointService)
 {
     _cardService   = cardService;
     _teamService   = teamService;
     _currentUserId = securityService.GetCurrentUserId();
     _pointService  = pointService;
 }
Exemplo n.º 17
0
 public PointServiceSource(
     TimeSpan pointTtl,
     IPointService pointGeneratingService)
 {
     this.pointTtl = pointTtl;
     this.pointGeneratingService = pointGeneratingService;
     this.kalmanFilterX          = new KalmanFilter(Settings.Default.KalmanFilterInitialValue, Settings.Default.KalmanFilterConfidenceOfInitialValue,
                                                    Settings.Default.KalmanFilterProcessNoise, Settings.Default.KalmanFilterMeasurementNoise);
     this.kalmanFilterY = new KalmanFilter(Settings.Default.KalmanFilterInitialValue, Settings.Default.KalmanFilterConfidenceOfInitialValue,
                                           Settings.Default.KalmanFilterProcessNoise, Settings.Default.KalmanFilterMeasurementNoise);
 }
Exemplo n.º 18
0
 public GameRoundService(
     ApplicationDbContext applicationDbContext,
     IPointService pointService,
     IBluffService bluffService,
     IRoundAnswerService roundAnswerService,
     IGameService gameService,
     IMapper mapper) : base(applicationDbContext, mapper)
 {
     _pointService       = pointService;
     _bluffService       = bluffService;
     _roundAnswerService = roundAnswerService;
     _gameService        = gameService;
 }
Exemplo n.º 19
0
        static void Main(string[] args)
        {
            // Get service provider
            serviceProvider = ServiceHelper.RegisterServices();
            // Get specific service
            IConsoleService consoleService = serviceProvider.GetService <IConsoleService>();
            IPlayerService  playerService  = serviceProvider.GetService <IPlayerService>();
            IPointService   pointService   = serviceProvider.GetService <IPointService>();
            //Play tennis game
            GameManager game = new GameManager(consoleService, playerService, pointService);

            game.PlayGame();
            //Dispose services
            ServiceHelper.DisposeServices(serviceProvider);
        }
Exemplo n.º 20
0
 public ApiWorkContext(
     ICacheManager cacheManager,
     IAreaService areaService,
     IStationService stationService,
     IStationTypeService stationTypeService,
     IRoomService roomService,
     IRoomTypeService roomTypeService,
     IDeviceService deviceService,
     IDeviceTypeService deviceTypeService,
     IFsuService fsuService,
     IPointService pointService,
     ILogicTypeService logicTypeService,
     ISCVendorService vendorService,
     ISignalService signalService,
     IAAlarmService aalarmService,
     IHAlarmService halarmService,
     IAMeasureService ameasureService,
     IHMeasureService hmeasureService,
     IRoleService roleService,
     IEntitiesInRoleService authService,
     IUserService userService,
     IGroupService groupService)
 {
     this._cacheManager       = cacheManager;
     this._areaService        = areaService;
     this._stationService     = stationService;
     this._stationTypeService = stationTypeService;
     this._roomService        = roomService;
     this._roomTypeService    = roomTypeService;
     this._deviceService      = deviceService;
     this._deviceTypeService  = deviceTypeService;
     this._fsuService         = fsuService;
     this._pointService       = pointService;
     this._logicTypeService   = logicTypeService;
     this._vendorService      = vendorService;
     this._signalService      = signalService;
     this._aalarmService      = aalarmService;
     this._halarmService      = halarmService;
     this._ameasureService    = ameasureService;
     this._hmeasureService    = hmeasureService;
     this._roleService        = roleService;
     this._authService        = authService;
     this._userService        = userService;
     this._groupService       = groupService;
 }
Exemplo n.º 21
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="channelToRemotePoint">Channel to remote point</param>
 /// <param name="currentPointChannel">Channel of point from which request will be performed</param>
 internal Point(Channel channelToRemotePoint, Channel currentPointChannel, ControlSpace space)
 {
     if (currentPointChannel == null)
     {
         currentPointChannel = channelToRemotePoint;
     }
     _pointThatUsingThisPoint = currentPointChannel;
     Channel       = channelToRemotePoint;
     _controlSpace = space;/*
                            * if (channelToRemotePoint.IP == currentPointChannel.IP && channelToRemotePoint.Type != ChannelType.TCP)
                            * {
                            * _PointServiceClient = ChannelFactory<IPointService>.CreateChannel(WCFSettings.GetNamedPipeBinding(), new EndpointAddress($"net.pipe://{channelToRemotePoint.IP}/{channelToRemotePoint.Port}"));
                            * }
                            * else*/
     {
         _PointServiceClient = ChannelFactory <IPointService> .CreateChannel(WCFSettings.GetTcpBinding(), new EndpointAddress($"net.tcp://{channelToRemotePoint.IP}:{channelToRemotePoint.Port}"));
     } //
 }
Exemplo n.º 22
0
        public HomeController(IPointService pointService, IGHeatService gheatService)
        {
            if (pointService == null)
            {
                throw new ArgumentNullException("Point Service");
            }

            _pointService = pointService;

            if (gheatService == null)
            {
                throw new ArgumentNullException("GHeat Service");
            }

            _gheatService = gheatService;

            _points = _pointService.LoadPoints();
        }
Exemplo n.º 23
0
 public TestController(
     UserManager <ApplicationUser> userManager,
     IUserService s1,
     ITestService s2,
     IQuestionService s3,
     IPointService s4,
     IResultService s5,
     ITypeService s6
     )
 {
     _userManager    = userManager;
     testService     = s2;
     questionService = s3;
     pointService    = s4;
     resultService   = s5;
     typeService     = s6;
     userService     = s1;
 }
Exemplo n.º 24
0
        public TestsBase()
        {
            // Configure application services logic through DI
            var services = new ServiceCollection();

            ConfigureMemory(services);
            ConfigureAppSettings(services);
            ConfigureInterfaces(services);

            var serviceProvider = services.BuildServiceProvider();

            _pointService     = serviceProvider.GetService <IPointService>();
            _routeBaseService = serviceProvider.GetService <IRouteBaseService>();
            _routeStepService = serviceProvider.GetService <IRouteStepService>();
            _stepService      = serviceProvider.GetService <IStepService>();
            _userService      = serviceProvider.GetService <IUserService>();

            var context = serviceProvider.GetService <DataContext>();

            context.Database.EnsureCreated();
        }
Exemplo n.º 25
0
        public void Points_UpdatePoints_CaseOfAdvantage()
        {
            ServiceProvider serviceProvider = ServiceHelper.RegisterServices();
            IPointService   pointService    = serviceProvider.GetService <IPointService>();
            Player          playerA         = new Player("Player A");
            Player          playerB         = new Player("Player B");

            pointService.UpdatePlayerPoints(playerA, playerB, playerA.Name);
            Assert.AreEqual(Points.Fifteen, playerA.Points);

            pointService.UpdatePlayerPoints(playerA, playerB, playerA.Name);
            Assert.AreEqual(Points.Thirty, playerA.Points);

            pointService.UpdatePlayerPoints(playerA, playerB, playerB.Name);
            Assert.AreEqual(Points.Fifteen, playerB.Points);

            pointService.UpdatePlayerPoints(playerA, playerB, playerB.Name);
            Assert.AreEqual(Points.Thirty, playerB.Points);

            pointService.UpdatePlayerPoints(playerA, playerB, playerA.Name);
            Assert.AreEqual(Points.Forty, playerA.Points);

            pointService.UpdatePlayerPoints(playerA, playerB, playerB.Name);
            Assert.AreEqual(Points.Forty, playerB.Points);

            //Player A takes advantage
            pointService.UpdatePlayerPoints(playerA, playerB, playerA.Name);
            Assert.AreEqual(Points.Advantage, playerA.Points);
            //Point for Player B, it removes the advantage from player A
            pointService.UpdatePlayerPoints(playerA, playerB, playerB.Name);
            Assert.AreEqual(Points.Forty, playerA.Points);
            //Point for Player B
            pointService.UpdatePlayerPoints(playerA, playerB, playerB.Name);
            Assert.AreEqual(Points.Advantage, playerB.Points);
            //Player B wins the game
            pointService.UpdatePlayerPoints(playerA, playerB, playerB.Name);
            Assert.AreEqual(Points.Game, playerB.Points);
        }
Exemplo n.º 26
0
 public ServiceFactory(
     IUserService userService,
     IInternService internService,
     IPointService pointService,
     IDepartmentService departmentService,
     ITrainingService trainingService,
     IEventTypeService eventTypeService,
     IQuestionService questionService,
     IEventService eventService,
     IOrganizationService organizationService,
     IActivityService activityService)
 {
     _userService         = userService;
     _internService       = internService;
     _pointService        = pointService;
     _departmentService   = departmentService;
     _organizationService = organizationService;
     _trainingService     = trainingService;
     _eventService        = eventService;
     _eventTypeService    = eventTypeService;
     _questionService     = questionService;
     _activityService     = activityService;
 }
Exemplo n.º 27
0
        public void Points_AlwaysWinsPlayerA()
        {
            Player          playerA         = new Player("PlayerA");
            Player          playerB         = new Player("PlayerB");
            Player          winner          = new Player();
            ServiceProvider serviceProvider = ServiceHelper.RegisterServices();
            IPointService   pointService    = serviceProvider.GetService <IPointService>();
            IPlayerService  playerService   = serviceProvider.GetService <IPlayerService>();

            while (true)
            {
                string pointWinnerName = playerA.Name;
                //Update player points points
                pointService.UpdatePlayerPoints(playerA, playerB, pointWinnerName);
                //Get Winner Player
                winner = playerService.GetGameWinnerPlayer(playerA, playerB);
                if (winner != null)
                {
                    Assert.AreEqual(playerA.Name, winner.Name);
                    break;
                }
            }
        }
Exemplo n.º 28
0
 public VoteConsumer(IPointService pointService)
 {
     _pointService = pointService;
 }
Exemplo n.º 29
0
 public LeagueService(ApplicationDbContext dbContext, IPointService pointService)
 {
     this.dbContext    = dbContext;
     this.pointService = pointService;
 }
Exemplo n.º 30
0
 public PointController(IPointService pointService, IUserDataService userDataService)
 {
     _pointService    = pointService;
     _userDataService = userDataService;
 }
Exemplo n.º 31
0
 public SquareController(IPointService pointService)
 {
     this.pointService = pointService;
 }
 public PointsController(IPointService pointService, IMapper mapper)
 {
     _pointService = pointService;
     _mapper       = mapper;
 }