public void WhenTheWorkFlowIsInitializedTheFirstActionIsLogin() { var facade = new WorkflowFacade(); var actions = facade.GetAvailableActions(); Assert.That(actions.Any(IsLoginAction()), Is.True); }
public void WhenIncorrectLoginDetailsSuppliedResultIsANullSession() { var facade = new WorkflowFacade(); var result = facade.ExecuteAction(typeof(LoginAction), new LoginCredentials("username", "")); Assert.That(result, Is.TypeOf <NullSession>()); }
public void WhenCorrectLoginCredentialsSuppliedResultIsASessionId() { var facade = new WorkflowFacade(); var result = facade.ExecuteAction(typeof(LoginAction), new LoginCredentials("username", "password")); Assert.That(result, Is.TypeOf <SessionId>()); }
public void WhenLoginUnsuccessfulWorkflowActionRemainsAsLogin() { var facade = new WorkflowFacade(); facade.ExecuteAction(typeof(LoginAction), new LoginCredentials("username", "")); var actionsPostLogin = facade.GetAvailableActions(); var postLoginAction = actionsPostLogin.First(); Assert.That(postLoginAction, Is.EqualTo(typeof(LoginAction))); }
public void OnceLoggedInCanLogout() { var facade = new WorkflowFacade(); facade.ExecuteAction(typeof(LoginAction), new LoginCredentials("username", "password")); facade.ExecuteAction(typeof(LogoutAction), null); var actions = facade.GetAvailableActions(); var loginAvailable = actions.Any(IsLoginAction()); Assert.That(loginAvailable, Is.True); }
public void AfterSuccessfulLoginThroughWorkflowActionBecomesLogout() { var facade = new WorkflowFacade(); var actions = facade.GetAvailableActions(); facade.ExecuteAction(actions.First(), new LoginCredentials("username", "password")); var actionsPostLogin = facade.GetAvailableActions(); var postLoginAction = actionsPostLogin.First(IsLogoutAction()); Assert.That(postLoginAction, Is.EqualTo(typeof(LogoutAction))); }