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