Inheritance: System.EventArgs
Esempio n. 1
0
			public void ShouldBeInErrorStateOnAnyOtherException() {
				var result = new GetStatusResult(WebServiceError.Unknown, new InvalidCastException());
				var args = new StatusEventArgs(result);

				_statusProvider.Raise(provider => provider.StatusUpdated += null, args);

				Assert.AreEqual(_viewModel.State, NestViewModelState.Error);
			}
Esempio n. 2
0
			public void ShouldNotBeLoggingInOnServerNotFoundException() {
				var result = new GetStatusResult(WebServiceError.ServerNotFound, new Exception());
				var args = new StatusEventArgs(result);

				_statusProvider.Raise(provider => provider.StatusUpdated += null, args);

				Assert.AreNotEqual(_viewModel.State, NestViewModelState.LoggingIn);
			}
Esempio n. 3
0
			public void ShouldNotBeInErrorStateOnCanceledException() {
				var result = new GetStatusResult(WebServiceError.Cancelled, new Exception());
				var args = new StatusEventArgs(result);

				_statusProvider.Raise(provider => provider.StatusUpdated += null, args);

				Assert.AreNotEqual(_viewModel.State, NestViewModelState.Error);
			}
Esempio n. 4
0
			public void ShouldLogToAnalyticsOnException() {
				var expectedException = new Exception();
				var result = new GetStatusResult(WebServiceError.Unknown, expectedException);
				var args = new StatusEventArgs(result);

				_statusProvider.Raise(provider => provider.StatusUpdated += null, args);

				_analyticsService.Verify(analytics => analytics.LogError(expectedException));
			}
Esempio n. 5
0
			public void ShouldSetCurrentErrorToErrorOnSessionTokenExpiredException() {
				var expectedError = WebServiceError.SessionTokenExpired;
				var result = new GetStatusResult(expectedError, new Exception());
				var args = new StatusEventArgs(result);

				_statusProvider.Raise(provider => provider.StatusUpdated += null, args);

				Assert.AreEqual(expectedError, _viewModel.CurrentError);
			}
Esempio n. 6
0
			public void ShouldClearSessionOnInvalidCredentialsException() {
				var result = new GetStatusResult(WebServiceError.InvalidCredentials, new Exception());
				var args = new StatusEventArgs(result);

				_statusProvider.Raise(provider => provider.StatusUpdated += null, args);

				_sessionProvider.Verify(provider => provider.ClearSession(), "Expected session to be cleared when an InvalidCredentials exception occurs.");
			}
Esempio n. 7
0
			public void ShouldBeLoggingInOnInvalidCredentialsException() {
				var result = new GetStatusResult(WebServiceError.InvalidCredentials, new Exception());
				var args = new StatusEventArgs(result);

				_statusProvider.Raise(provider => provider.StatusUpdated += null, args);

				Assert.AreEqual(_viewModel.State, NestViewModelState.LoggingIn);
			}
Esempio n. 8
0
		private void OnStatusUpdated(object sender, StatusEventArgs e) {
			if (IsErrorHandled(e.Status.Error, e.Status.Exception))
				return;

			UpdateViewModelFromGetStatusResult(e.Status);
		}