public TrackerController(ITrackerService trackerService, IAlertTextProvider alertTextProvider, IMySession mySession, IPermissionChecker permissionChecker) { _trackerService = trackerService; _alertTextProvider = alertTextProvider; _mySession = mySession; _permissionChecker = permissionChecker; }
public void Init() { var messengerMock = new Mock<IMessenger>(); var serviceMock = new Mock<ITrackerService>(); _Messenger = messengerMock.Object; _MockPriorityList = new List<string>() { "High", "Low" }; _MockStatusList = new List<string>() { "In Progress", "Closed" }; _MockActiveProject = new ProjectViewModel(new Project { Id = 1, Code = "GGGGG", Description = "", Name = "TestProject" }); _AssignedUserMock = new User() { Id = 5, FirstName = "Adam", Username = "******", Password = "******" }; _MockProjectUsersList = new List<User>() { _AssignedUserMock}; serviceMock.Setup<List<string>>(p => p.GetBugPriorityList()).Returns(_MockPriorityList); serviceMock.Setup<List<string>>(p => p.GetBugStatusList()).Returns(_MockStatusList); serviceMock.Setup<List<User>>(p => p.GetUsersByProject(_MockActiveProject.ToProjectModel())).Returns(_MockProjectUsersList); serviceMock.Setup<User>(p => p.GetMyUser()).Returns(_AssignedUserMock); var _MockNotifier = new Mock<IGrowlNotifiactions>(); _ServiceMock = serviceMock.Object; _ActiveProjectStub = new ProjectViewModel(new Project { Id = 5, Description = "Stub Project", Name = "Stub Title" }); _AddPanel = new BugAddPanelViewModel(_Messenger, _ServiceMock, _MockActiveProject, _MockNotifier.Object); }
public StatsController(ITrackerService trackerService, IEventService eventService, ICustomizationService customizationService) { _trackerService = trackerService; _eventService = eventService; _customizationService = customizationService; }
/// <summary> /// Initialises the panel object. /// </summary> /// <param name="comm">Messenger object to communicate with other view models.</param> /// <param name="svc">The bug tracker web service.</param> /// <param name="activeProj">The currently active project.</param> public BugAddPanelViewModel(IMessenger comm, ITrackerService svc, ProjectViewModel activeProj, IGrowlNotifiactions notifier) : base(comm, svc, activeProj) { InitialiseBugViewModel(); _Notifier = notifier; }
public void Setup() { logger = A.Fake <ILogger <TrackerService> >(); actionService = A.Fake <ITrackerActionService>(); trackerService = new TrackerService(logger, actionService); }
public TripReasonController(ITrackerService objIClsTripReason, IAlertTextProvider alertTextProvider, IPermissionChecker permissionChecker, IMySession mySession) { _trackerService = objIClsTripReason; _alertTextProvider = alertTextProvider; _permissionChecker = permissionChecker; _mySession = mySession; }
/// <summary> /// Stores dependencies and initialises selected bug list. Also /// sets up a message listener to recieve incoming messages. /// </summary> /// <param name="comm">The mediator for communicatin with other view models.</param> /// <param name="svc">The bug tracker web service.</param> /// <param name="activeProj">The currently active project</param> public BugTableViewModel(IMessenger comm, ITrackerService svc, IGrowlNotifiactions notifier, IControlFactory ctrlfactory, ProjectViewModel activeProj) { _Messenger = comm; _Service = svc; _ControlFactory = ctrlfactory; if (activeProj != null && activeProj.Id != 0) { _ActiveProject = activeProj; ProjectTitle = activeProj.Name; } _Notifier = notifier; _SearchText = ""; _PageSize = GetPageSizeFromSettings(); _DefaultTableSortOrder = new SortDescription("Id", ListSortDirection.Descending); _BugListViewSource.Source = _BugList; InitSortingAndPaging(); if (_ActiveProject != null) { UpdateTableData(); } ListenForMessages(); }
public ProjectPanelViewModel(ITrackerService svc, IMessenger mess) { _Messenger = mess; _Service = svc; Project = new ProjectViewModel(); }
public CommonController(IFleetService fleetService, IUserService userService, ITrackerService trackerService, IMySession mySession) { _trackerService = trackerService; _mySession = mySession; _fleetService = fleetService; _userService = userService; }
public ExperienceDataFactory(IVisitsRepository visitsRepository, IPersonalInfoRepository personalInfoRepository, IOnsiteBehaviorRepository onsiteBehaviorRepository, IReferralRepository referralRepository, ITrackerService trackerService) { this.visitsRepository = visitsRepository; this.personalInfoRepository = personalInfoRepository; this.onsiteBehaviorRepository = onsiteBehaviorRepository; this.referralRepository = referralRepository; this.trackerService = trackerService; }
public ProjectUsersPanelViewModel(ITrackerService svc, IMessenger messenger, ProjectViewModel proj) { this._Service = svc; this._Messenger = messenger; this._Project = proj; ListenForMessages(); }
public WestSideBarViewModel(ITrackerService svc, IMessenger mess, ProjectViewModel activeProj) { _Service = svc; _Messenger = mess; _ActiveProject = activeProj; ListenForMessages(); }
public ProjectAddPanelViewModel(ITrackerService svc, IMessenger mess, IGrowlNotifiactions notifier) : base(svc, mess) { _Notifier = notifier; ButtonName = "Add & Close"; PanelTitle = "Add Project"; }
/// <summary> /// Enregistre un objet comme service courant de tracking /// </summary> /// <param name="service">objet à enregistrer</param> public static void RegisterTracker( ITrackerService service ) { if ( box != null ) box.StopService(); if ( !Registry.Has( TrackerServiceKeys.KeyTrackerService ) ) Registry.Remove( box ); box = null; if ( service == null ) return; Registry.Add( TrackerServiceKeys.KeyTrackerService, service ); box = service; }
public AssignedProjectsPanelViewModel(IMessenger mess, ITrackerService svc, User currentUser) { _Service = svc; _Messenger = mess; _CurrentUser = currentUser; ListenForMessages(); IsVisible = true; }
public ProjectViewPanelViewModel(ITrackerService svc, IMessenger mess, ProjectViewModel selectedProj, IGrowlNotifiactions notifier) : base(svc, mess) { Project = selectedProj.Clone(); _Notifier = notifier; ButtonName = "Save & Close"; PanelTitle = "Edit Project"; }
public void TrackLogin_Call_ShouldTrackLoginGoal(string identifier, Db db, [Frozen] ITrackerService trackerService, [Greedy] AccountTrackerService accountTrackerService) { //Arrange db.Add(new DbItem("Item", AccountTrackerService.LoginGoalId)); //Act accountTrackerService.TrackLogin(identifier); //Assert trackerService.Received().TrackPageEvent(Arg.Is <ID>(AccountTrackerService.LoginGoalId)); }
public MapForm(ITrackerService trackerService, IMapService mapService, IAPIMapperService converter, IDistanceService distanceService, ISpeedService speedService) { InitializeComponent(); this.trackerService = trackerService; this.mapService = mapService; this.converter = converter; this.distanceService = distanceService; this.speedService = speedService; this.mapService.PositionUpdated += MapService_PositionUpdated; }
public void Execute_OutcomeIsNotID_DoNotRegisterOutcome(string outcome, [Frozen] ITrackerService trackerService, [Greedy] RegisterOutcome registerOutcome) { //Arrange registerOutcome.Outcome = outcome; //Act registerOutcome.Execute(ID.Null, null); //Assert trackerService.DidNotReceive().TrackOutcome(Arg.Any <ID>()); }
public void Execute_OutcomeID_RegisterOutcome(Db db, ID outcomeId, [Frozen] ITrackerService trackerService, [Greedy] RegisterOutcome registerOutcome) { //Arrange db.Add(new DbItem("WrongOutcome", outcomeId, Constants.OutcomeTemplateId)); registerOutcome.Outcome = outcomeId.ToString(); //Act registerOutcome.Execute(ID.Null, null); //Assert trackerService.Received().TrackOutcome(outcomeId); }
public ManagedProjectsPanelViewModel(ITrackerService svc, IMessenger mess, IControlFactory ctrlFactory, User currentUser, IGrowlNotifiactions notifier) { _Service = svc; _Messenger = mess; _Factory = ctrlFactory; _CurrentUser = currentUser; _Notifier = notifier; ListenForMessages(); }
public SidebarRepository(VisitsRepository visitsRepository, PersonalInfoRepository personalInformationRepository, OnsiteBehaviorRepository onsiteBehaviorRepository, ReferralRepository referralRepository, ITrackerService trackerService) { _visitsRepository = visitsRepository; _personalInformationRepository = personalInformationRepository; _onsiteBehaviorRepository = onsiteBehaviorRepository; _referralRepository = referralRepository; _trackerService = trackerService; }
/// <summary> /// Initialises the bug view panel and de-references the selected bug to /// ensure updates to the edited bug do not reflect in the bug table. /// Also initialises a message listener to monitor changes in selected bug. /// </summary> /// <param name="comm">The mediator object for communication between view models.</param> /// <param name="svc">The bug tracker web service.</param> /// <param name="activeProj">The currently active project.</param> /// <param name="selectedBug">The currently selected bug</param> public BugViewPanelViewModel(IMessenger comm, ITrackerService svc, ProjectViewModel activeProj, BugViewModel selectedBug, IGrowlNotifiactions notifier) : base(comm, svc, activeProj) { if (selectedBug == null) throw new ArgumentNullException("The selected bug cannot be null."); _Notifier = notifier; UpdateBugView(selectedBug); ListenForMessages(); }
/// <summary> /// Stores references to dependencies and initialises the /// username field by retrieving currents user from service. /// </summary> /// <param name="comm">Messenger to communciate with other view models.</param> /// <param name="svc">Web service allowing remote procedures to be called.</param> /// <param name="ctrlfactory">Factory to create controls on the main window.</param> public MainWindowViewModel(IMessenger comm, ITrackerService svc, IWindowFactory winfactory, IControlFactory ctrlfactory) { _Messenger = comm; _Service = svc; _ControlFactory = ctrlfactory; _WindowFactory = winfactory; _CurrentUser = _Service.GetMyUser(); InitialiseActiveProject(); ListenForMessages(); }
private void Awake() { _trackerService = GetComponent <ITrackerService>(); //TODO: (bad) В случае если не используете внедрение зависимостей var canvas = GameObject.FindObjectsOfType(typeof(UIElement)) .Cast <UIElement>() .Where(x => x.id == "canvas"); var ui = (UserInterface)canvas.First().gameObject.AddComponent(typeof(UserInterface)); //TODO: тоже плохо. Но Unity по другому не умеет _userInterface = ui.Inject(this); _portal = (Portal)FindObjectOfType(typeof(Portal)); }
/// <summary> /// Stores references to dependencies and initialses object fields. /// </summary> /// <param name="loader">The window loader.</param> /// <param name="svc">The registration web service.</param> public AccountSettingsViewModel(ITrackerService svc, IMessenger mess, IGrowlNotifiactions notifier) { _Service = svc; _Messenger = mess; _Notifier = notifier; User myUser = _Service.GetMyUser(); _FirstName = myUser.FirstName; _LastName = myUser.Surname; _FirstAndLastName = _FirstName + " " + _LastName; _Email = myUser.Username; _Password = myUser.Password; }
/// <summary> /// Initialises the bug view panel and de-references the selected bug to /// ensure updates to the edited bug do not reflect in the bug table. /// Also initialises a message listener to monitor changes in selected bug. /// </summary> /// <param name="comm">The mediator object for communication between view models.</param> /// <param name="svc">The bug tracker web service.</param> /// <param name="activeProj">The currently active project.</param> /// <param name="selectedBug">The currently selected bug</param> public BugViewPanelViewModel(IMessenger comm, ITrackerService svc, ProjectViewModel activeProj, BugViewModel selectedBug, IGrowlNotifiactions notifier) : base(comm, svc, activeProj) { if (selectedBug == null) { throw new ArgumentNullException("The selected bug cannot be null."); } _Notifier = notifier; UpdateBugView(selectedBug); ListenForMessages(); }
public void Setup() { request = new BattleshipRequest() { Length = 2, Orientation = "vertical", Position = new Coordinates { X = 2, Y = 3 } }; validationService = new Mock <IValidationService>(); cacheService = new Mock <ICacheService>(); trackerService = new TrackerService(cacheService.Object, validationService.Object); }
/// <summary> /// Stores references to dependencies and listens for incoming messages. /// </summary> /// <param name="comm">The mediator which allows communication between view models.</param> /// <param name="svc">The bug tracker web service.</param> /// <param name="activeProj"></param> public CommandPanelViewModel(IMessenger comm, ITrackerService svc, ProjectViewModel activeProj) { if (comm == null) throw new ArgumentNullException("The messenger cannot be null."); if (svc == null) throw new ArgumentNullException("Web service cannot be null."); _Messenger = comm; _Service = svc; if (!IsProjectNull(activeProj)) _ActiveProject = activeProj; ListenForMessages(); }
public void Init() { var messengerMock = new Mock <IMessenger>(); var serviceMock = new Mock <ITrackerService>(); _Messenger = messengerMock.Object; _MockPriorityList = new List <string>() { "High", "Low" }; _MockStatusList = new List <string>() { "In Progress", "Closed" }; _MockActiveProject = new ProjectViewModel(new Project { Id = 1, Code = "GGGGG", Description = "", Name = "TestProject" }); _AssignedUserMock = new User() { Id = 5, FirstName = "Adam", Username = "******", Password = "******" }; _MockProjectUsersList = new List <User>() { _AssignedUserMock }; serviceMock.Setup <List <string> >(p => p.GetBugPriorityList()).Returns(_MockPriorityList); serviceMock.Setup <List <string> >(p => p.GetBugStatusList()).Returns(_MockStatusList); serviceMock.Setup <List <User> >(p => p.GetUsersByProject(_MockActiveProject.ToProjectModel())).Returns(_MockProjectUsersList); serviceMock.Setup <User>(p => p.GetMyUser()).Returns(_AssignedUserMock); var _MockNotifier = new Mock <IGrowlNotifiactions>(); _ServiceMock = serviceMock.Object; _ActiveProjectStub = new ProjectViewModel(new Project { Id = 5, Description = "Stub Project", Name = "Stub Title" }); _AddPanel = new BugAddPanelViewModel(_Messenger, _ServiceMock, _MockActiveProject, _MockNotifier.Object); }
public CameraViewModel( CameraModel camera, ITrackerService trackerService, ICameraService cameraService, IConsoleService consoleService, HelixCameraVisualizationService visualizationService) { Camera = camera; TrackerService = trackerService; CameraService = cameraService; ConsoleService = consoleService; VisualizationService = visualizationService; CameraService.Initialize(Camera); TrackerService.Initialize(Camera); VisualizationService.Initialize(Camera); if (!IsInDesignMode) { Messenger.Default.Register<AddMotionControllerMessage>(this, message => { TrackerService.AddMotionController(message.MotionController); }); Messenger.Default.Register<RemoveMotionControllerMessage>(this, message => { TrackerService.RemoveMotionController(message.MotionController); }); // add existing controllers foreach (MotionControllerViewModel mcvw in SimpleIoc.Default.GetAllCreatedInstances<MotionControllerViewModel>()) { TrackerService.AddMotionController(mcvw.MotionController); } SimpleIoc.Default.Register(() => this, Camera.GUID, true); Messenger.Default.Send(new AddCameraMessage(Camera)); // try loading previously saved configurations for this camera SimpleIoc.Default.GetInstance<ISettingsService>().LoadCamera(camera); Camera.Calibration = SimpleIoc.Default.GetInstance<SettingsViewModel>().SettingsService.LoadCalibration(Camera.GUID); } }
public MilestoneViewModel(INavigation navigation = null) : base(navigation) { trackerService = DependencyService.Get <ITrackerService>(); metaService = DependencyService.Get <IMetaService>(); authenticationService = DependencyService.Get <IAuthenticationService>(); userMilestoneService = DependencyService.Get <IUserMilestoneService>(); SetPageImageSize(); ShowBadgeAchievedImage = false; BadgeAchievedImage = string.Empty; StringFemale = StringFemaleDefault; StringMale = StringMaleDefault; ColorFemale = ColorMale = ColorGenderDefault; ActionType = ActionType.Check; BaseContent = null; CurrentWeightMinimumValue = 0; CurrentWeightMaximumValue = App.Configuration.AppConfig.MAXIMUM_WEIGHT_LOSE; CurrentWeightValue = CurrentWeightMinimumValue; UserTrackers = new List <UserTracker>(); UserMetas = new UserMeta(); WeightLossGoal = 0; PreviousWeight = 0; GoalAchieved = false; CurrentWeightEnabled = true; MilestoneAchieved = false; AchievedContent = null; CurrentTitle = TextResources.CurrentWeight; CurrentSubTitle = string.Empty; IsCurrentSubTitle = false; ImageFront = ImageDefault; ImageSide = ImageDefault; TShirtSize = string.Empty; AboutYourJourney = ErrorMessage; MilestoneExtended = new UserMilestoneExtended(); Milestones = new List <MilestonePercentage>(); UserMilestones = new List <UserMilestone>(); ViewComponents = new List <View>(); GetUserTracker(); }
/// <summary> /// Stores references to dependencies and listens for incoming messages. /// </summary> /// <param name="comm">The mediator which allows communication between view models.</param> /// <param name="svc">The bug tracker web service.</param> /// <param name="activeProj"></param> public CommandPanelViewModel(IMessenger comm, ITrackerService svc, ProjectViewModel activeProj) { if (comm == null) { throw new ArgumentNullException("The messenger cannot be null."); } if (svc == null) { throw new ArgumentNullException("Web service cannot be null."); } _Messenger = comm; _Service = svc; if (!IsProjectNull(activeProj)) { _ActiveProject = activeProj; } ListenForMessages(); }
/// <summary> /// Stores references to dependencies and sets up a message listener. /// </summary> /// <param name="comm">The communication channel with other view models.</param> /// <param name="svc">The bug tracker web service.</param> /// <param name="activeProj">The currently active project.</param> public BugPanelViewModel(IMessenger comm, ITrackerService svc, ProjectViewModel activeProj) { if (comm == null) { throw new ArgumentNullException("The messenger cannot be null."); } if (activeProj == null) { throw new ArgumentNullException("The active project cannot be null."); } if (svc == null) { throw new ArgumentNullException("The web service cannot be null."); } _Messenger = comm; _Service = svc; _ActiveProject = activeProj; ListenForMessages(); }
public JoinProjectPanelViewModel(ITrackerService svc, IGrowlNotifiactions notifier) { _Service = svc; _Notifier = notifier; _User = svc.GetMyUser(); }
public HomeController(ITrackerService trackerService) { _trackerService = trackerService; }
private void Tracker_FormClosed( object sender, FormClosedEventArgs e ) { box = null; }
public AccountTrackerService(IAccountsSettingsService accountsSettingsService, ITrackerService trackerService) { this.accountsSettingsService = accountsSettingsService; this.trackerService = trackerService; }
public TrackVisitors(ITrackerService trackerService) { _trackerService = trackerService; }
public RegisterOutcome(ITrackerService trackerService) { this.trackerService = trackerService; }