public async Task CanUseParamForLiteral() { var responseCreator = new LiteralResponse("$foo", endpoint); Assert.Equal("FOO", await responseCreator.GetBodyAsync(null)); fooParam.Value = "BAR"; Assert.Equal("BAR", await responseCreator.GetBodyAsync(null)); Assert.Equal("BAR", (await GetResponseAsync(responseCreator)).WrittenContent); }
public void ReplacementsAreExecuted() { var responseCreator = new LiteralResponse("abc def"); responseCreator.Replacements = new[] { new BodyReplacement { SearchTerm = "abc", ReplacementTerm = "ABC" }, new BodyReplacement { SearchTerm = "def", ReplacementTerm = "DEF" } }; var body = responseCreator.GetBodyAndExecuteReplacements(null); Assert.Equal("ABC DEF", body); }
public async Task ReplacementsAreExecuted() { var responseCreator = new LiteralResponse("abc def", new Endpoint("foo", "bar")) { Replacements = new[] { new BodyReplacement { SearchTerm = "abc", ReplacementTerm = "ABC" }, new BodyReplacement { SearchTerm = "def", ReplacementTerm = "DEF" } } }; var body = await responseCreator.GetBodyAndExecuteReplacementsAsync(null); Assert.Equal("ABC DEF", body); }