public void GetUser_WithNonExistingUsername_ByUsernameAndPassword_ThrowException() { string username = "******"; string password = "******"; var service = new DataService(); service.GetUser(username, password, APPKEY); }
public void GetUser_WithNonExistingUsername_ByHash_ThrowException() { string username = "******"; string password = "******"; var hasher = SHA256.Create(); var hashbytes = hasher.ComputeHash(Encoding.ASCII.GetBytes(username + password)); var service = new DataService(); service.GetUserByHash(Encoding.ASCII.GetString(hashbytes), APPKEY); }
public void GetUser_WithExistingUsernameByUsernameAndPassword_ReturnsUser() { string username = "******"; string password = "******"; var service = new DataService(); var user = service.GetUser(username, password, APPKEY); Assert.IsNotNull(user); Assert.IsInstanceOfType(user, typeof(User)); }
public void RegisterUser_WithValidExistingUser_ThrowException() { var userToRegister = new User { Username = "******", Password = "******" }; var service = new DataService(); service.RegisterUser(userToRegister, APPKEY); }
public void GetUser_WithNullUsername_ThrowException() { var service = new DataService(); service.GetUser(null, "12345", APPKEY); }
public void GetUser_WithNullUsernameAndPassword_ThrowException() { var service = new DataService(); service.GetUser(null, null, APPKEY); }
public void GetUser_WithNullPassword_ThrowException() { var service = new DataService(); service.GetUser("foo", null, APPKEY); }
public void GetUser_WithNullHash_ThrowException() { var service = new DataService(); service.GetUserByHash(null, APPKEY); }
public void RegisterUser_WithValidNonExistingUser_ReturnsUser() { var userToRegister = new Common.Entities.User { Username = "******", Password = "******" }; var service = new DataService(); service.RegisterUser(userToRegister, APPKEY); }