예제 #1
0
        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"
            });
        }
예제 #2
0
        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");
        }
예제 #3
0
        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");
        }