示例#1
0
 public void ConstructorTest()
 {
     var iniConfig = new IniConfig(_testLines);
     Assert.That(iniConfig.Count, Is.EqualTo(2));
     Assert.That(iniConfig["ABC"], Is.EqualTo("123"));
     Assert.That(iniConfig["abc"], Is.EqualTo("123"));
     Assert.That(iniConfig["Defgh"], Is.EqualTo("true"));
     Assert.That(iniConfig["wrongKey"], Is.Empty);
 }
示例#2
0
 public void GetIniLinesTest()
 {
     var iniConfig = new IniConfig(_testLines);
     iniConfig["newKey"] = "newValue";
     iniConfig["abc"] = "456";
     CollectionAssert.AreEquivalent(iniConfig.GetIniLines(),
         new List<string>
         {
             "ABC=456",
             "defgh=true",
             "newKey=newValue"
         });
 }
示例#3
0
 public void SetNewKeyTest()
 {
     var iniConfig = new IniConfig(_testLines);
     iniConfig["newKey"] = "newValue";
     Assert.That(iniConfig["NEWKEY"], Is.EqualTo("newValue"));
 }
示例#4
0
 public void SetForbiddenNewKeyTest()
 {
     var iniConfig = new IniConfig(_testLines);
     iniConfig.ForbidNewKeys = true;
     iniConfig["newKey"] = "newValue";
 }
示例#5
0
 public void SetExistingTest()
 {
     var iniConfig = new IniConfig(_testLines);
     iniConfig["abc"] = "456";
     Assert.That(iniConfig["ABC"], Is.EqualTo("456"));
 }