1
Answer

NUnit Testing for User Authentication of Login Form

Ask a question
Anusha Popuri

Anusha Popuri

11y
1.8k
1
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)