예제 #1
0
 public void ParseConfigHandlesBadConversions()
 {
     Assert.AreEqual(5, AdapterConfig.ParseConfig <int>("not an int", 5));
 }
예제 #2
0
 public void ParseConfigHandlesEmptyString()
 {
     Assert.AreEqual(0, AdapterConfig.ParseConfig <int>(""));
 }
예제 #3
0
 public void ParseConfigUsesDefault()
 {
     Assert.AreEqual("foobar", AdapterConfig.ParseConfig <string>(null, "foobar"));
 }
예제 #4
0
 public void ParseConfigUsesTypeDefault()
 {
     Assert.AreEqual(0, AdapterConfig.ParseConfig <int>(null));
 }
예제 #5
0
 public void ParseConfigSafelyConvertsNull()
 {
     Assert.AreEqual(false, AdapterConfig.ParseConfig <bool>(null));
 }