コード例 #1
0
        public void Simple_Flow_Is_Serialized_With_Full_Abbreviations()
        {
            TypeAbbreviationCache.Clear();
            TypeAbbreviationCache.RegisterFromAssembly(GetType().Assembly, useFullName: true, failOnCollision: false);

            var containerBuilder = new ContainerBuilder();

            containerBuilder.RegisterBanzaiNodes(GetType().Assembly, true);

            var flowBuilder = new FlowBuilder <object>(new AutofacFlowRegistrar(containerBuilder));

            flowBuilder.CreateFlow("TestFlow1")
            .AddRoot <IPipelineNode <object> >()
            .AddChild <ITestJsNode>()
            .AddChild <ITestNode2>();

            var rootComponent = flowBuilder.RootComponent;

            var serializer = new JsonComponentSerializer();

            var definition = serializer.Serialize(rootComponent);

            Console.WriteLine(definition);

            definition.ShouldNotBeNull().ShouldNotBeEmpty();
            definition.ShouldContain("Banzai.Json.Test");
        }
コード例 #2
0
 public WhenSerializingBasicFlow(ITestOutputHelper testOutputHelper)
 {
     _testOutputHelper = testOutputHelper;
     TypeAbbreviationCache.Clear();
     TypeAbbreviationCache.RegisterCoreTypes();
 }