Esempio n. 1
0
        public void Given_NoQuerystring_When_Query_Invoked_Then_It_Should_Return_Result(string querystring)
        {
            var context = new Mock <FunctionContext>();

            var baseHost = "localhost";
            var uri      = Uri.TryCreate($"http://{baseHost}?{querystring}", UriKind.Absolute, out var tried) ? tried : null;

            var req = (HttpRequestData) new FakeHttpRequestData(context.Object, uri, headers: null);

            var result = (string)OpenApiHttpRequestDataExtensions.Query(req, "hello");

            result.Should().BeNull();
        }
Esempio n. 2
0
        public void Given_Null_When_Query_Invoked_Then_It_Should_Throw_Exception()
        {
            Action action = () => OpenApiHttpRequestDataExtensions.Query(null, null);

            action.Should().Throw <ArgumentNullException>();
        }