Example #1
0
        public void IsPalindrome()
        {
            var  x      = new StringToBool();
            bool result = x.IsPalindrome("hannah");

            Assert.IsTrue(result);
        }
Example #2
0
        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));
        }
Example #3
0
        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);
        }
Example #5
0
        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));
        }