public async void testAuthenticateNullValue() { //Arrange string username = ""; string password = ""; bool expectAuthenticated = false; //Act AuthenticateJsonResult result = await MyMartService.AuthenWithUsername(username, password); //Assert Assert.IsTrue(result.Authenticated == expectAuthenticated); }
public async void testAuthenticateSucess() { //Arrange string username = "******"; string password = "******"; string expectUserID = "bc9ce5ff-1731-457f-bee3-336a99165c22"; //Act AuthenticateJsonResult result = await MyMartService.AuthenWithUsername(username, password); //Assert Assert.IsTrue(result.UserID == expectUserID); }
public async void testAuthenticateFail() { //Arrange string username = "******"; string password = "******"; bool expectAuthenticated = false; //Act AuthenticateJsonResult result = await MyMartService.AuthenWithUsername(username, password); //Assert Assert.IsTrue(result.Authenticated == expectAuthenticated); }
private async void loginButton_Click(object sender, RoutedEventArgs e) { AuthenticateJsonResult result = await MyMartService.AuthenWithUsername(userNameTextBox.Text, passwordBox.Password); if (result.Authenticated) { LocalSetting.UserID = result.UserID; LoggedIn(sender, e); } else { MessageDialog messageDialog = new MessageDialog(result.ExceptionMessage, "Authentication Fail"); await messageDialog.ShowAsync(); } }