Пример #1
0
        public void Invoke_CallsDumpThreads()
        {
            var dumper = new TestThreadDumper();
            var ep     = new ThreadDumpEndpoint(new ThreadDumpEndpointOptions(), dumper);
            var result = ep.Invoke();

            Assert.NotNull(result);
            Assert.True(dumper.DumpThreadsCalled);
        }
Пример #2
0
        public void Invoke_CallsDumpThreads()
        {
            using (var tc = new TestContext(_output))
            {
                var dumper = new TestThreadDumper();
                tc.AdditionalServices = (services, configuration) =>
                {
                    services.AddSingleton <IThreadDumper>(dumper);
                    services.AddThreadDumpActuatorServices(configuration, MediaTypeVersion.V1);
                };

                var ep     = tc.GetService <IThreadDumpEndpoint>();
                var result = ep.Invoke();
                Assert.NotNull(result);
                Assert.True(dumper.DumpThreadsCalled);
            }
        }