public void ExceptionTestFor_ValidUser_InvalidPassword() { User user = new User { Id = 1, UserName = "******", Age = 23, Location = "bangalore", Gender = "male", Password = "******", Interest = "Cosmetics" }; //Action //Assert var ex = Assert.Throws <InvalidCredentialsExecptions>(() => User_Service.Login("abc", "987654321")); var exc = Assert.Throws <InvalidCredentialsExecptions>(() => Advertiser_Service.Login("ab", "9876547321")); Assert.Equal("Please enter valid usename & password", ex.Messages); Assert.Equal("Please enter valid usename & password", exc.Messages); }
public void TestFor_Valid_SignInForAdvertiser() { //Action var IsLoggedFromAdvertiser = Advertiser_Service.Login(advertiser.UserName, advertiser.Password); //Assert Assert.True(IsLoggedFromAdvertiser); }