Пример #1
0
        public void TestCreatePSCredential_CreatesCredentialWithGivenUser()
        {
            const string expectedUser = "******";
            PSCredential result       = RemotePowerShellUtils.CreatePSCredential(expectedUser, DefaultPassword);

            Assert.AreEqual(expectedUser, result.UserName);
        }
Пример #2
0
        public void TestCreatePSCredential_CreatesCredentialWithGivenPassword()
        {
            const string expectedPassword = "******";
            PSCredential result           = RemotePowerShellUtils.CreatePSCredential(DefaultUser, expectedPassword);

            Assert.AreEqual(expectedPassword.Length, result.Password.Length);
        }
Пример #3
0
        public void TestCreatePSCredential_ThrowsForInvalidPassword(string invalidPassword)
        {
            var e = Assert.ThrowsException <ArgumentException>(
                () => RemotePowerShellUtils.CreatePSCredential(DefaultUser, invalidPassword));

            Assert.AreEqual("input", e.Message);
        }