public void WritePropertyFile_Test() { var file = new JavaProperties(); file.Add(new PropertyLine("dbpassword", "password")); file.Add(new PropertyLine("database", "localhost ♣ st")); file.Add(new PropertyLine("King Kong", "a really long value ioio")); var properties = JavaProperties.Read(file.ToString()); Assert.AreEqual("password", properties["dbpassword"].Value); Assert.AreEqual("localhost ♣ st", properties["database"].Value); Assert.AreEqual("King Kong", properties["King Kong"].Key); Assert.AreEqual("a really long value ioio", properties["King Kong"].Value); }
public void TestJavaPropertiesSaveAndLoad() { JavaProperties props = new JavaProperties(); JavaProperties props1 = new JavaProperties(); props.Add("a=", "b=\"''"); props.Store("c:\\tempPropFileCsharp.txt", "comment1"); props1.Load("c:\\tempPropFileCsharp.txt"); File.Delete("c:\\tempPropFileCsharp.txt"); Assert.AreEqual(props1["a="], props["a="]); }