Ejemplo n.º 1
0
        private static void SimulateHttpRequest(Action<SentryRequest> test)
        {
            using (var simulator = new HttpSimulator())
            {
                simulator.SetFormVariable("Form1", "Value1");
                simulator.SetHeader("UserAgent", "SharpRaven");
                simulator.SetCookie("Cookie", "Monster");

                using (simulator.SimulateRequest())
                {
                    var request = SentryRequest.GetRequest();
                    test.Invoke(request);
                }
            }
        }
Ejemplo n.º 2
0
        private static void SimulateHttpRequest(Action<JsonPacket> test)
        {
            using (var simulator = new HttpSimulator())
            {
                simulator.SetFormVariable("Form1", "Value1")
                         .SetCookie("Cookie1", "Value1")
                         .SetHeader("Header1", "Value1")
                         .SetReferer(new Uri("http://getsentry.com/"));

                using (simulator.SimulateRequest())
                {
                    var json = new JsonPacket(Guid.NewGuid().ToString("n"));
                    test.Invoke(json);
                }
            }
        }