public void OnGet_GivenNoUserIsAuthenticated_ExpectNoMfaTypesSet() { var mediator = new Mock <IMediator>(); var currentAuthenticatedUserProvider = new Mock <ICurrentAuthenticatedUserProvider>(); currentAuthenticatedUserProvider.Setup(x => x.CurrentAuthenticatedUser).Returns(Maybe <ISystemUser> .Nothing); var page = new ValidateDeviceMfa(currentAuthenticatedUserProvider.Object, mediator.Object); page.OnGet(); Assert.False(page.HasApp); }
public void OnGet_GivenUserIsAuthenticated_ExpectMfaTypesToBeSet() { var mediator = new Mock <IMediator>(); var currentAuthenticatedUserProvider = new Mock <ICurrentAuthenticatedUserProvider>(); currentAuthenticatedUserProvider.Setup(x => x.CurrentAuthenticatedUser) .Returns(Maybe.From( new UnauthenticatedUser( TestVariables.UserId, MfaProvider.App | MfaProvider.Device) as ISystemUser)); var page = new ValidateDeviceMfa(currentAuthenticatedUserProvider.Object, mediator.Object); page.OnGet(); Assert.True(page.HasApp); }