Exemple #1
0
        static void Main()
        {
            string json = Console.In.ReadToEnd();

            var v2obj     = JsonConvert.DeserializeObject <V2Object>(json);
            var evaluator = new Evaluator(new StringConverter());
            var v3obj     = VersionConverter.Convert(v2obj, evaluator);

            Console.Write(JsonConvert.SerializeObject(v3obj, Formatting.Indented));
        }
Exemple #2
0
        public void ConverterTests(string jsonV2File, string jsonV3File)
        {
            var v2json = File.ReadAllText(projectPath + jsonV2File);
            var v3json = File.ReadAllText(projectPath + jsonV3File);

            var v2obj          = JsonConvert.DeserializeObject <V2Object>(v2json);
            var evaluator      = new Evaluator(new StringConverter());
            var v3obj          = VersionConverter.Convert(v2obj, evaluator);
            var v3obj_expected = JsonConvert.DeserializeObject <V3Object>(v3json);

            v3obj.Should().BeEquivalentTo(v3obj_expected);
        }