public void ReturnsCorrectResultWithDerivedMetadataValue() { // Given InitialMetadata initialMetadata = new InitialMetadata { ["A"] = new DerivedMetadataValue { Key = "X" }, ["X"] = "x" }; Metadata metadata = new Metadata(initialMetadata); // When object value = metadata.Get("A"); // Then Assert.AreEqual("x", value); }
public void MetadataValueCalledForEachRequest() { // Given SimpleMetadataValue metadataValue = new SimpleMetadataValue { Value = "a" }; InitialMetadata initialMetadata = new InitialMetadata { ["A"] = metadataValue }; Metadata metadata = new Metadata(initialMetadata); // When object value = metadata.Get("A"); value = metadata.Get("A"); value = metadata.Get("A"); // Then Assert.AreEqual("a", value); Assert.AreEqual(3, metadataValue.Calls); }
public void GetWithMetadataValueCalledForEachRequest() { // Given Engine engine = new Engine(); engine.Trace.AddListener(new TestTraceListener()); SimpleMetadataValue metadataValue = new SimpleMetadataValue { Value = "a" }; engine.Metadata["A"] = metadataValue; Metadata metadata = new Metadata(engine); // When object value = metadata.Get("A"); value = metadata.Get("A"); value = metadata.Get("A"); // Then Assert.AreEqual("a", value); Assert.AreEqual(3, metadataValue.Calls); }
public void GetWithMetadataValueReturnsCorrectResult() { // Given InitialMetadata initialMetadata = new InitialMetadata { ["A"] = "a" }; Metadata metadata = new Metadata(initialMetadata); // When object value = metadata.Get("A"); // Then Assert.AreEqual("a", value); }
public void GetWithDerivedMetadataValueReturnsCorrectResult() { // Given Engine engine = new Engine(); engine.Trace.AddListener(new TestTraceListener()); engine.Metadata["X"] = "x"; engine.Metadata["A"] = new DerivedMetadataValue { Key = "X" }; Metadata metadata = new Metadata(engine); // When object value = metadata.Get("A"); // Then Assert.AreEqual("x", value); }