Tests.StatsdTests.Timer.send_timer_with_lamba_still_records_on_error_and_still_bubbles_up_exception C# (CSharp) Method

send_timer_with_lamba_still_records_on_error_and_still_bubbles_up_exception() private method

            public void send_timer_with_lamba_still_records_on_error_and_still_bubbles_up_exception()
            {
                const string statName = "name";
                var stopwatch = MockRepository.GenerateMock<IStopwatch>();
                stopwatch.Stub(x => x.ElapsedMilliseconds()).Return(500);
                _stopwatch.Stub(x => x.Get()).Return(stopwatch);

                var s = new Statsd(_udp, _randomGenerator, _stopwatch);
                Assert.Throws<InvalidOperationException>(() => s.Send(() => { throw new InvalidOperationException(); }, statName));

                _udp.AssertWasCalled(x => x.Send("name:500|ms"));
            }