Anusha Popuri

Anusha Popuri

  • NA
  • 5
  • 10.6k

NUnit Testing for User Authentication of Login Form

Aug 23 2013 3:24 AM
Hi,

Here is my code for button login..i m not getting how to implement nunit test code.could you please help me.

                    IUserService iservice = this.channel.CreateChannel();



                        string token = iservice.AuthenticateUser(this.txtUserName.Text, this.txtPwd.Text);
                        EndpointAddressBuilder builder = new EndpointAddressBuilder(this.channel.Endpoint.Address);
                        AddressHeader header = AddressHeader.CreateAddressHeader("token", "", token);
                        builder.Headers.Add(header);
                        LoginUtility.EndPoint = builder.ToEndpointAddress();

                        this.channel = new ChannelFactory<IUserService>(binding, LoginUtility.EndPoint);
                        iservice = this.channel.CreateChannel();
                        User response = iservice.GetUserInfoByLoginId(this.txtUserName.Text);
                        LoginUtility.UserID = response.UserID;
                        LoginUtility.UserType = response.Type;
       
Thank you,
Anusha.




Answers (1)