Beispiel #1
0
        public static void TestPipeArgDeserialization()
        {
            var jsonV1 = new PipeArgs(new[] { new PipeArg("cancel", ArgMode.Inject, 2) }).ToJson(Pipes.ArgJCfg);
            var jsonV0 = @"{
  ""$type"": ""Mutuo.Etl.Pipe.PipeArg[], Mutuo.Etl"",
  ""$values"": [
    {
      ""$type"": ""Mutuo.Etl.Pipe.PipeArg, Mutuo.Etl"",
      ""name"": ""options"",
      ""value"": {
        ""$type"": ""YtReader.UpdateOptions, YtReader""
      }
    },
    {
      ""$type"": ""Mutuo.Etl.Pipe.PipeArg, Mutuo.Etl"",
      ""name"": ""cancel"",
      ""argMode"": 2
    }
  ]
}".ParseJObject();

            var v2 = Pipes.LoadInArgs(jsonV0);

            v2.Version.Should().Be(PipeArgs.Versions.V1);
            v2.Values.First(v => v.Name == "cancel").ArgMode.Should().Be(ArgMode.Inject);
        }