Exemple #1
0
        public void FixedValueCodecs_EncodesProperly(string expected, string type, object input)
        {
            var result = "";

            switch (type)
            {
            case "bool":
                result = Bool.EncodeString((bool)input);
                break;

            case "decimal":
                result = Decimal.EncodeString(Convert.ToDecimal(expected));
                break;

            case "guid":
                result = Guid.EncodeString(new Guid((string)input));
                break;

            case "int":
                result = Int.EncodeString((int)input);
                break;

            case "string":
                result = String.EncodeString((string)input);
                break;
            }
            Assert.Equal(expected, result);
        }