Beispiel #1
0
            public void ReturnsCorrectResultWithMetadataValue()
            {
                // Given
                MetadataDictionary initialMetadata = new MetadataDictionary
                {
                    ["A"] = new SimpleMetadataValue { Value = "a" }
                };
                MetadataStack metadata = new MetadataStack(initialMetadata);

                // When
                object value;
                bool contains = metadata.TryGetValue("A", out value);

                // Then
                Assert.IsTrue(contains);
                Assert.AreEqual("a", value);
            }
Beispiel #2
0
            public void ReturnsFalseForInvalidValue()
            {
                // Given
                MetadataDictionary initialMetadata = new MetadataDictionary {["A"] = "a"};
                MetadataStack metadata = new MetadataStack(initialMetadata);

                // When
                object value;
                bool contains = metadata.TryGetValue("B", out value);

                // Then
                Assert.IsFalse(contains);
                Assert.AreEqual(null, value);
            }