public void ToStringGeneratesPublicString() { PrivateString hidden = "private"; var args = new PrivateArguments("public", hidden); Assert.AreEqual("public " + hidden.PublicValue, args.ToString()); }
public void ToStringPrivateGeneratesPublicString() { PrivateString hidden = "private"; var args = new PrivateArguments("public", hidden); Assert.AreEqual("public private", args.ToString(SecureDataMode.Private)); }
public void ConstructorStoresValue() { var value = "testData"; var privateString = new PrivateString(value); Assert.AreEqual(value, privateString.PrivateValue); }
private void AppendUsernameAndPassword(PrivateArguments builder) { if (!string.IsNullOrEmpty(Username)) { PrivateString userPlusPass = "******"-Y" + Username + "," + Password.PrivateValue + "\""; builder.Add(userPlusPass); } }
public void ToStringWithPrivateReturnsPrivateValue() { var testString = new PrivateString { PrivateValue = "hidden" }; Assert.AreEqual(testString.PrivateValue, testString.ToString(SecureDataMode.Private)); }
public void ToStringReturnsPublicValue() { var testString = new PrivateString { PrivateValue = "hidden" }; Assert.AreEqual(testString.PublicValue, testString.ToString()); }
public void PublicValueReturnsMask() { var value = "testData"; var privateString = new PrivateString { PrivateValue = value }; Assert.AreNotEqual(value, privateString); }
public void PlusOperatorAddsPrivateValue() { PrivateArguments args = "test args"; args += new PrivateString { PrivateValue = "value" }; Assert.AreEqual(2, args.Count); Assert.AreEqual("test args ********", args.ToString()); }
public void ToStringReturnsPrivateDataInPrivateMode() { var value = "testData"; var privateString = new PrivateString { PrivateValue = value }; var actual = privateString.ToString(SecureDataMode.Private); Assert.AreEqual(value, actual); }
public void ToStringReturnsPublicData() { var value = "testData"; var privateString = new PrivateString { PrivateValue = value }; var actual = privateString.ToString(); Assert.AreNotEqual(value, actual); }
public void PublicIsHiddenPrivateIsSeen() { var testValue = "testValue"; var theString = new PrivateString { PrivateValue = testValue }; Assert.AreEqual(testValue, theString.PrivateValue); Assert.AreNotEqual(testValue, theString.PublicValue); }
public void ImplicitConvertsFromString() { PrivateString theString = "testing"; Assert.AreEqual("testing", theString.PrivateValue); }