Write() 공개 메소드

public Write ( ) : void
리턴 void
예제 #1
0
        public void write_a_test()
        {
            Test test = DataMother.MathProject().LoadTests().GetAllTests().First();
            var node = new JsonNode("Test");

            var visitor = new WriterVisitor(test, node);
            visitor.Write();

            Debug.WriteLine(node.ToJson());
        }
예제 #2
0
        public void write_a_second_test()
        {
            var section = new Section("AutoDispatchConfiguration");
            Test test = new Test("AutoDispatchRules").With(section);

            Step step1 = section.AddStep("IfPriorityEquals").With("priority", "High");
            StepLeaf leaf1 = step1.LeafFor("AndOr");
            leaf1.Add(new Step("AndStatusEquals").With("status", "Open"));
            leaf1.Add(new Step("AndTitleEquals").With("title", "This one"));

            StepLeaf leaf2 = step1.LeafFor("AutoDispatchAction");
            leaf2.Add(new Step("AssignToUser").With("user", "annieAgent"));

            var node = new JsonNode("Test");

            var visitor = new WriterVisitor(test, node);
            visitor.Write();

            Debug.WriteLine(node.ToJson());
        }