public async Task LoginSuccessful() { var loginFormModel = new LoginFormModel(); var controller = new Controller(loginFormModel); controller.Machine.HandleResponseAsync("login", new HttpResponseMessage(HttpStatusCode.OK)); Assert.Equal("Successfully logged in", loginFormModel.StatusMessage); }
public async Task ResetForm() { var loginFormModel = new LoginFormModel() { UserName = "******", Password = "******" }; var controller = new Controller(loginFormModel); controller.Machine.HandleResponseAsync("reset", new HttpResponseMessage(HttpStatusCode.OK)); Assert.Equal("", loginFormModel.UserName); Assert.Equal("", loginFormModel.Password); }
public async Task LoginFailed() { var loginFormModel = new LoginFormModel(); var controller = new Controller(loginFormModel); controller.Machine.HandleResponseAsync("login", new HttpResponseMessage(HttpStatusCode.Unauthorized)); Assert.Equal("Credentials invalid", loginFormModel.StatusMessage); }