示例#1
0
        public void Finding_A_Post_RawRequest_Substitutes_Variables(string folderName, string requestName)
        {
            variables.Enrich(new
            {
                firstName = "Zaphod",
                surname   = "Beeblebrox"
            });

            var folder  = sut.FindFolder(folderName);
            var request = folder.FindRaw(requestName, variables);

            request.EnrichedContent.Should().NotBe(request.RawContent, "we expect them to be unequal");
            request.Url.Should().Contain("Zaphod");
            request.Url.Should().Contain("Beeblebrox");
        }
示例#2
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");
        }