Esempio n. 1
0
        public void HeapDumpEndpointMiddleware_PathAndVerbMatching_ReturnsExpected()
        {
            var        opts   = new HeapDumpOptions();
            HeapDumper obs    = new HeapDumper(opts);
            var        ep     = new HeapDumpEndpoint(opts, obs);
            var        middle = new HeapDumpEndpointOwinMiddleware(null, ep);

            Assert.True(middle.RequestVerbAndPathMatch("GET", "/heapdump"));
            Assert.False(middle.RequestVerbAndPathMatch("PUT", "/heapdump"));
            Assert.False(middle.RequestVerbAndPathMatch("GET", "/badpath"));
        }
        public void HeapDumpEndpointMiddleware_PathAndVerbMatching_ReturnsExpected()
        {
            var        opts   = new HeapDumpEndpointOptions();
            var        mopts  = TestHelpers.GetManagementOptions(opts);
            HeapDumper obs    = new HeapDumper(opts);
            var        ep     = new HeapDumpEndpoint(opts, obs);
            var        middle = new HeapDumpEndpointOwinMiddleware(null, ep, mopts);

            Assert.True(middle.RequestVerbAndPathMatch("GET", "/cloudfoundryapplication/heapdump"));
            Assert.False(middle.RequestVerbAndPathMatch("PUT", "/cloudfoundryapplication/heapdump"));
            Assert.False(middle.RequestVerbAndPathMatch("GET", "/cloudfoundryapplication/badpath"));
        }