コード例 #1
0
        public void write_enumerable_properties()
        {
            var report = new ValueDiagnosticReport();
            report.StartChild("A", 0);
            report.Value("B", 0);
            report.EndChild();

            report.StartChild("A", 1);
            report.Value("B", 1);
            report.EndChild();

            report.StartChild("A", 2);
            report.Value("B", 2);
            report.EndChild();

            report.AllValues().Select(x => x.Key)
                .ShouldHaveTheSameElementsAs("A[0].B", "A[1].B", "A[2].B");
        }
コード例 #2
0
        public void writes_the_source()
        {
            var report = new ValueDiagnosticReport();

            report.StartSource(new SettingsData(null, "Ralph"));
            report.Value("A", 1);
            report.EndSource();

            report.StartSource(new SettingsData(null, "Potsie"));
            report.Value("A", 2);
            report.EndSource();

            report.AllValues().Single().Key.ShouldEqual("A");

            var value = report.For("A");
            value.First().ShouldEqual(new DiagnosticValueSource("Ralph", 1));

            value.ShouldHaveTheSameElementsAs(new DiagnosticValueSource("Ralph", 1), new DiagnosticValueSource("Potsie", 2));
        }
コード例 #3
0
        public void write_second_level_properties()
        {
            var report = new ValueDiagnosticReport();
            report.StartChild("A");
            report.Value("B", 2);

            report.StartChild("C");
            report.Value("D", 4);

            report.EndChild();
            report.Value("E", 5);

            report.EndChild();
            report.Value("F", 6);

            report.AllValues().Select(x => x.Key)
                .ShouldHaveTheSameElementsAs("A.B", "A.C.D", "A.E", "F");
        }
コード例 #4
0
        public void write_first_level_properties()
        {
            var report = new ValueDiagnosticReport();

            report.Value("C", 3);
            report.Value("A", 1);
            report.Value("B", 2);

            report.AllValues().Select(x => x.Key)
                .ShouldHaveTheSameElementsAs("A", "B", "C");
        }