public void IsPalindrome() { var x = new StringToBool(); bool result = x.IsPalindrome("hannah"); Assert.IsTrue(result); }
public void TestStrict() { string trueValue = "Yes"; string falseValue = "No"; StringToBool target = new StringToBool(trueValue, falseValue); Assert.AreEqual(true, target.Convert(trueValue, this.service)); Assert.AreEqual(false, target.Convert(falseValue, this.service)); }
public void TestStrictMissingValue() { string trueValue = "Yes"; string falseValue = "No"; string missingValue = "A small sheep"; StringToBool target = new StringToBool(trueValue, falseValue); target.Convert(missingValue, this.service); }
public void IsPalindrome() { StringToBool x = new StringToBool(); bool result = x.IsPalindrome("ABCBA"); bool falseresult = x.IsPalindrome("ABCA"); Assert.IsTrue(result); Assert.IsFalse(falseresult); }
public void TestWithMultipleConverters() { string trueValue = "Yes"; StringMapTranslation stringMapConverter = new StringMapTranslation(new Dictionary <string, string> { ["Yes"] = "Y" }); StringToBool toBoolConverter = new StringToBool("Y"); FieldMap map = new FieldMap("source", "dest", stringMapConverter, toBoolConverter); Assert.AreEqual(true, ImportMap.ConvertValue(trueValue, map, new BooleanAttributeMetadata(), service)); }