public WhenAUserStartsARestingPhase() { Controller.Post(Request, TimeWarpCommand.Rest); FakeNowProvider.Now = new DateTime(2000, 12, 12, 12, 12, 0, 5); _result = Controller.Get(Request); }
public void ThenAnEventIsRaisedToNotifyTheUi() { var mockUserStateService = new MockUserStateService(); using (var userStatePresenter = new UserStateListener(mockUserStateService, null)) { userStatePresenter.Start(); bool success; using (var manualResetEvent = new ManualResetEvent(false)) { userStatePresenter.UserStateChanged += (sender, e) => manualResetEvent.Set(); var workingState = new UserStateInfoResponse(1, "test", new DateTime(2000, 12, 12), TimeWarpState.Working, new DateTime(2000, 12, 12), TimeSpan.FromSeconds(12), 0.2, true, TimeWarpAgent.VisualStudio); mockUserStateService.SetUserState(workingState); success = manualResetEvent.WaitOne(TimeSpan.FromSeconds(10)); } Assert.IsTrue(success); Assert.AreEqual(TimeWarpState.Working, userStatePresenter.CurrentTimeWarpState); } }
public WhenAUserLogsIn() { CreateAccount(); Logout(); Login(); StartWork(); _result = GetCurrentState(); }
public WhenAUserStartsToWorkFromANewAgent() { CreateAccount(); StartRest(TimeWarpAgent.VisualStudio); Thread.Sleep(1500); StartWork(TimeWarpAgent.LinuxClient); _result = GetCurrentState(); }
public WhenAnAccountIsCreatedWithNoPassword() { CreateAccountWithNoPassword(); Logout(); LoginWithNoPassword(); StartWork(); _result = GetCurrentState(); }
public void Update(UserStateInfoResponse userStateInfoResponse) { if (userStateInfoResponse.AccountId != AccountId) { return; } Progress = userStateInfoResponse.Progress; }
public WhenAUserIsWorking() { CreateAccount(); StartWork(); _result1 = GetCurrentState(); Thread.Sleep(TimeSpan.FromMilliseconds(100)); _result2 = GetCurrentState(); Thread.Sleep(TimeSpan.FromMilliseconds(100)); _result3 = GetCurrentState(); }
public void Update(UserStateInfoResponse userStateInfoResponse) { if (userStateInfoResponse.AccountId != AccountId) { return; } Progress = (int)((1 - userStateInfoResponse.Progress) * 100); //Username = userStateInfoResponse.Username.Length; //if(!_isCurrentUser) // SortString = Username; RemainingTime = userStateInfoResponse.TimeLeft.Minutes.ToString(CultureInfo.InvariantCulture); CurrentState = userStateInfoResponse.State; NotificationsEnabled = userStateInfoResponse.State == TimeWarpState.Working ? Visibility.Visible : Visibility.Collapsed; }
public void SetUserState(UserStateInfoResponse userStateInfoResponse) { _userStateInfoResponse = userStateInfoResponse; }
public WhenAUserStartsToWork() { CreateAccount(); StartWork(); _result = GetCurrentState(); }
public WhenUserInformationIsRetrieved() { FakeNowProvider.Now = new DateTime(2000, 12, 12, 12, 12, 0, 5); _result = Controller.Get(Request); }
public WhenAUserStartsToRest() { CreateAccount(); StartRest(TimeWarpAgent.VisualStudio); _result = GetCurrentState(); }