예제 #1
0
        public void Should_replace_with_variable()
        {
            var formatter = new StringVariableReplacer();

            var result = formatter.Format("/cart/{cartId}", new Dictionary <string, string>
            {
                { "cartId", "me" }
            });

            Assert.Equal("/cart/me", result);
        }
예제 #2
0
        public void Should_replace_with_multiple_variables()
        {
            var formatter = new StringVariableReplacer();

            var result = formatter.Format("/cart/{cartId}/{customerId}", new Dictionary <string, string>
            {
                { "cartId", "me" },
                { "customerId", "1234" }
            });

            Assert.Equal("/cart/me/1234", result);
        }