Beispiel #1
0
 public static bool GetBool(this IDictionary <string, string> aValues, string aParam, bool aDefault = false)
 {
     return(TryParse.Bool(aValues.GetString(aParam), aDefault));
 }
 static void Null()
 {
     Assert.Equal(TryParse.Bool(null), None());
 }
 static void Success()
 {
     Assert.Equal(TryParse.Bool("true"), Some(true));
 }
 static void Fail()
 {
     Assert.Equal(TryParse.Bool("a"), None());
 }
Beispiel #5
0
 public static bool GetBool(this System.Xml.XmlReader aReader, string aAttribute, bool aDefault = false)
 {
     return(TryParse.Bool(aReader.GetAttribute(aAttribute), aDefault));
 }