示例#1
0
        public void ToStringGeneratesPublicString()
        {
            PrivateString hidden = "private";
            var           args   = new PrivateArguments("public", hidden);

            Assert.AreEqual("public " + hidden.PublicValue, args.ToString());
        }
示例#2
0
        public void ToStringPrivateGeneratesPublicString()
        {
            PrivateString hidden = "private";
            var           args   = new PrivateArguments("public", hidden);

            Assert.AreEqual("public private", args.ToString(SecureDataMode.Private));
        }
示例#3
0
        public void ConstructorStoresValue()
        {
            var value         = "testData";
            var privateString = new PrivateString(value);

            Assert.AreEqual(value, privateString.PrivateValue);
        }
示例#4
0
 private void AppendUsernameAndPassword(PrivateArguments builder)
 {
     if (!string.IsNullOrEmpty(Username))
     {
         PrivateString userPlusPass = "******"-Y" + Username + "," + Password.PrivateValue + "\"";
         builder.Add(userPlusPass);
     }
 }
示例#5
0
        public void ToStringWithPrivateReturnsPrivateValue()
        {
            var testString = new PrivateString
            {
                PrivateValue = "hidden"
            };

            Assert.AreEqual(testString.PrivateValue, testString.ToString(SecureDataMode.Private));
        }
示例#6
0
        public void ToStringReturnsPublicValue()
        {
            var testString = new PrivateString
            {
                PrivateValue = "hidden"
            };

            Assert.AreEqual(testString.PublicValue, testString.ToString());
        }
示例#7
0
        public void PublicValueReturnsMask()
        {
            var value         = "testData";
            var privateString = new PrivateString
            {
                PrivateValue = value
            };

            Assert.AreNotEqual(value, privateString);
        }
示例#8
0
        public void PlusOperatorAddsPrivateValue()
        {
            PrivateArguments args = "test args";

            args += new PrivateString
            {
                PrivateValue = "value"
            };
            Assert.AreEqual(2, args.Count);
            Assert.AreEqual("test args ********", args.ToString());
        }
示例#9
0
        public void ToStringReturnsPrivateDataInPrivateMode()
        {
            var value         = "testData";
            var privateString = new PrivateString
            {
                PrivateValue = value
            };
            var actual = privateString.ToString(SecureDataMode.Private);

            Assert.AreEqual(value, actual);
        }
示例#10
0
        public void ToStringReturnsPublicData()
        {
            var value         = "testData";
            var privateString = new PrivateString
            {
                PrivateValue = value
            };
            var actual = privateString.ToString();

            Assert.AreNotEqual(value, actual);
        }
示例#11
0
        public void PublicIsHiddenPrivateIsSeen()
        {
            var testValue = "testValue";
            var theString = new PrivateString
            {
                PrivateValue = testValue
            };

            Assert.AreEqual(testValue, theString.PrivateValue);
            Assert.AreNotEqual(testValue, theString.PublicValue);
        }
示例#12
0
        public void ImplicitConvertsFromString()
        {
            PrivateString theString = "testing";

            Assert.AreEqual("testing", theString.PrivateValue);
        }