Esempio n. 1
0
        public void Coercion_Coerce()
        {
            ICoercion coercion = new Coercion();

            var result = coercion.Coerce("source", typeof(string));

            Assert.Equal("source", result);
        }
Esempio n. 2
0
        public void Coercion_Coerce_JToken()
        {
            ICoercion coercion = new Coercion();
            var       writer   = new JTokenWriter();

            writer.WriteStartObject();
            writer.WritePropertyName("type");
            writer.WriteValue("request");
            writer.WritePropertyName("command");
            writer.WriteValue("launch");
            writer.WriteEndObject();

            var result = coercion.Coerce(writer.Token, typeof(JToken));

            Assert.Equal(writer.Token, result);
        }