public void ExceptionTestFor_UserCannotblank() { User user = new User() { UserName = "", UserPassword = "******", ReTypePassword = "******", Role = "" }; //Assert var ex = Assert.Throws <FieldscannotEmptyException>(() => _AdministratorServices.Register(user)); Assert.Equal("Fields can not be blank ", ex.Messages); }
public void Test_for_Register() { User user = new User() { UserId = 2, UserName = "******", UserPassword = "******", ReTypePassword = "******", Role = "Admin" }; var Result = _AdministratorServices.Register(user); Assert.True(Result); }