Ejemplo n.º 1
0
        public async Task LoginWithFailedAuthentication_Should_ShowError()
        {
            // Arrange
            var sessionService = new FakeSessionServiceWithException();
            TestInitialize(sessionService);

            // Act
            await _loginViewModel.LoginAsync();

            // Assert
            Assert.Equal(1, _telemetryService.ExceptionsTracked);
            Assert.Equal(1, _localNotificationService.NotificationsSent);
        }
Ejemplo n.º 2
0
        public async Task LoginWithExistingStoredToken_Should_Success()
        {
            // Arrange
            var sessionService = new FakeSessionServiceWithException();
            TestInitialize(sessionService);

            _passwordStorageService.Content = "123456";

            // Act
            await _loginViewModel.LoginAsync();

            // Assert
            Assert.Equal("Main", _navigationService.CurrentPageKey);
        }