public PostmanCollectionTests(ApiFixture fixture, ITestOutputHelper output) { sut = fixture.PostmanCollection(output); api = fixture.Api; variables = new MutableVariableContext(new { baseUrl = api.BaseAddress?.ToString().Trim('/') ?? "http://localhost:5042" }); }
public void Replaces_NullValues_With_EmptyString() { var sut = new MutableVariableContext(new { NullString = default(string?), NullObject = default(object), NullVariableContext = default(MutableVariableContext) }); sut.Variables["NullString"].Should().BeEmpty("a null-string should be treated as an empty string"); sut.Variables["NullObject"].Should().BeEmpty("a null-object should be treated as an empty string"); sut.Variables["NullVariableContext"].Should().BeEmpty("a null-VariableContext should be treated as an empty string"); }
public void Mutable_VariableContext_Does_Mutate() { var sut = new MutableVariableContext(new { foo = "bar" }); var enriched = sut.Enrich(new { bar = "foo" }); sut.Should().Be(enriched, "an enriched mutable variable-context should return itself"); sut.Variables.Keys.Should().BeEquivalentTo(new[] { "foo", "bar" }, "a mutable variable-context should change"); }