コード例 #1
0
        public void ReturnAReadOnlySecureString_WhenCallingGetSecureString()
        {
            // Arrange
            System.Security.SecureString encryptedString = new System.Security.SecureString();
            Assert.IsFalse(encryptedString.IsReadOnly());
            string password = "******";

            // Act
            encryptedString = SUT.GetSecureString(password);

            // Assert
            Assert.IsTrue(encryptedString.IsReadOnly());
        }
コード例 #2
0
        public void ReturnTheSameString_WhenCallingGetSecureAndGetUnsecure()
        {
            // Arrange
            string expected = "MyVoiceIsMyPassport!";

            System.Security.SecureString encryptedString;
            string actual = String.Empty;

            // Act
            encryptedString = SUT.GetSecureString(expected);
            actual          = SUT.GetUnsecureString(encryptedString);

            // Assert
            Assert.AreEqual(expected, actual);
        }