Exemple #1
0
 public void Overall()
 {
     Assert.AreEqual(10, _config.Count);
     Assert.IsTrue(_config.HasSection("sub-section"));
     Assert.IsTrue(_config.HasSection("sub-section/sub-section"));
     Assert.AreEqual(10, _config.AsInt("int"));
     Assert.AreEqual(10.10d, _config.AsDouble("double"));
     Assert.AreEqual(10.15m, _config.AsDecimal("decimal"));
     Assert.AreEqual(10.20f, _config.AsFloat("float"));
     Assert.AreEqual(20, _config.AsLong("long"));
     Assert.AreEqual(new DateTime(2021, 12, 11, 17, 23, 0), _config.AsDateTime("datetime"));
     Assert.IsTrue(_config.AsBoolean("boolean"));
     CollectionAssert.AreEqual(new[] { 1, 2, 3 }, _config.AsArray <int>("array"));
     CollectionAssert.AreEqual(new List <int> {
         1, 2, 3
     }, _config.AsList <int>("list"));
 }