public void TestCreatePSCredential_CreatesCredentialWithGivenUser() { const string expectedUser = "******"; PSCredential result = RemotePowerShellUtils.CreatePSCredential(expectedUser, DefaultPassword); Assert.AreEqual(expectedUser, result.UserName); }
public void TestCreatePSCredential_CreatesCredentialWithGivenPassword() { const string expectedPassword = "******"; PSCredential result = RemotePowerShellUtils.CreatePSCredential(DefaultUser, expectedPassword); Assert.AreEqual(expectedPassword.Length, result.Password.Length); }
public void TestCreatePSCredential_ThrowsForInvalidPassword(string invalidPassword) { var e = Assert.ThrowsException <ArgumentException>( () => RemotePowerShellUtils.CreatePSCredential(DefaultUser, invalidPassword)); Assert.AreEqual("input", e.Message); }