Ejemplo n.º 1
0
 public void GetUser_WithNonExistingUsername_ByUsernameAndPassword_ThrowException()
 {
     string username = "******";
     string password = "******";
     var service = new DataService();
     service.GetUser(username, password, APPKEY);
 }
Ejemplo n.º 2
0
 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);
 }
Ejemplo n.º 3
0
 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));
 }
Ejemplo n.º 4
0
 public void RegisterUser_WithValidExistingUser_ThrowException()
 {
     var userToRegister = new User
     {
         Username = "******",
         Password = "******"
     };
     var service = new DataService();
     service.RegisterUser(userToRegister, APPKEY);
 }
Ejemplo n.º 5
0
 public void GetUser_WithNullUsername_ThrowException()
 {
     var service = new DataService();
     service.GetUser(null, "12345", APPKEY);
 }
Ejemplo n.º 6
0
 public void GetUser_WithNullUsernameAndPassword_ThrowException()
 {
     var service = new DataService();
     service.GetUser(null, null, APPKEY);
 }
Ejemplo n.º 7
0
 public void GetUser_WithNullPassword_ThrowException()
 {
     var service = new DataService();
     service.GetUser("foo", null, APPKEY);
 }
Ejemplo n.º 8
0
 public void GetUser_WithNullHash_ThrowException()
 {
     var service = new DataService();
     service.GetUserByHash(null, APPKEY);
 }
Ejemplo n.º 9
0
 public void RegisterUser_WithValidNonExistingUser_ReturnsUser()
 {
     var userToRegister = new Common.Entities.User
     {
         Username = "******",
         Password = "******"
     };
     var service = new DataService();
     service.RegisterUser(userToRegister, APPKEY);
 }