public async Task DoesNotInterpolateNonStrings() { // Given TestDocument document = new TestDocument { { "Foo", new StringBuilder("ABC {1+2} XYZ") } }; InterpolateMetadata interpolate = new InterpolateMetadata(); // When IReadOnlyList <TestDocument> results = await ExecuteAsync(document, interpolate); // Then results.ShouldHaveSingleItem(); results[0]["Foo"].ToString().ShouldBe("ABC {1+2} XYZ"); }
public async Task InterpolatesMetadata() { // Given TestDocument document = new TestDocument { { "Foo", "ABC {1+2} XYZ" } }; InterpolateMetadata interpolate = new InterpolateMetadata(); // When IReadOnlyList <TestDocument> results = await ExecuteAsync(document, interpolate); // Then results.ShouldHaveSingleItem(); results[0]["Foo"].ShouldBe("ABC 3 XYZ"); }
public async Task NonInterpolatedMetadataIsAvailable() { // Given TestDocument document = new TestDocument { { "Foo", "ABC {Bar} XYZ" }, { "Bar", 5 } }; InterpolateMetadata interpolate = new InterpolateMetadata(); // When IReadOnlyList <TestDocument> results = await ExecuteAsync(document, interpolate); // Then results.ShouldHaveSingleItem(); results[0]["Foo"].ShouldBe("ABC 5 XYZ"); }