public void AddUser_ValidateUserName_Fail() { Usermanager usermanager = new Usermanager(r); string check = usermanager.AddUser("@#$ÅÄÖ"); Assert.IsNull(check); }
public void AddUser_Success() { Usermanager usermanager = new Usermanager(r); string check = usermanager.AddUser("Martin"); Assert.IsNotNull(check); }
public void WrongPassword_CastsException() { Usermanager usermanager = new Usermanager(r); //Create user string password = usermanager.AddUser("Martin"); //Change password usermanager.ChangePassword("Martin", "OK", "P@ssw0rd"); }
public void AddUser_ReturnsPassword() { Usermanager usermanager = new Usermanager(r); string newpassword = usermanager.AddUser("Martin"); //How can we verify random output data? Insert our own random generator... Dependency Injection Assert.AreEqual("abcdefg", newpassword); }
public void GetSHA512() { Usermanager usermanager = new Usermanager(r); //Create user string password = usermanager.AddUser("Martin"); //Change password usermanager.ChangePassword("Martin", password, "P@ssw0rd"); //Check that we can use the new password Assert.AreEqual("KrwZWp+QMJzee36albLxYFTn+TQ1oohiI5TivJOU4bF1sNc3V3Ugs8GJN71lLuJV/T0l8XsgfSXKtMuk/KO4/g==", usermanager.Get_Base64Encoded_SHA512Hash("Martin")); }
public void ChangePassword_Success() { Usermanager usermanager = new Usermanager(r); //Create user string password = usermanager.AddUser("Martin"); //Change password usermanager.ChangePassword("Martin", password, "OK"); //Check that we can use the new password Assert.AreEqual(true,usermanager.Validate("Martin", "OK")); }
public void ChangePassword_Success() { Usermanager usermanager = new Usermanager(r); //Create user string password = usermanager.AddUser("Martin"); //Change password usermanager.ChangePassword("Martin", password, "OK"); //Check that we can use the new password Assert.AreEqual(true, usermanager.Validate("Martin", "OK")); }