コード例 #1
0
ファイル: MetadataTests.cs プロジェクト: ryanrousseau/Wyam
            public void EnumeratingMetadataValuesReturnsCorrectResults()
            {
                // Given
                InitialMetadata initialMetadata = new InitialMetadata
                {
                    ["A"] = new SimpleMetadataValue {Value = "a"},
                    ["B"] = new SimpleMetadataValue {Value = "b"},
                    ["C"] = new SimpleMetadataValue {Value = "c"}
                };
                Metadata metadata = new Metadata(initialMetadata);

                // When
                object[] values = metadata.Select(x => x.Value).ToArray();

                // Then
                CollectionAssert.AreEquivalent(new[] {"a", "b", "c"}, values);
            }
コード例 #2
0
ファイル: MetadataFixture.cs プロジェクト: Chandu/Wyam
        public void EnumeratingMetadataValuesReturnsCorrectResults()
        {
            // Given
            Engine engine = new Engine();
            engine.Trace.AddListener(new TestTraceListener());
            engine.Metadata["A"] = new SimpleMetadataValue { Value = "a" };
            engine.Metadata["B"] = new SimpleMetadataValue { Value = "b" };
            engine.Metadata["C"] = new SimpleMetadataValue { Value = "c" };
            Metadata metadata = new Metadata(engine);

            // When
            object[] values = metadata.Select(x => x.Value).ToArray();

            // Then
            CollectionAssert.AreEquivalent(new [] { "a", "b", "c" }, values);
        }