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

set_return_value_with_send_timer_with_lambda() private method

private set_return_value_with_send_timer_with_lambda ( ) : void
return void
            public void set_return_value_with_send_timer_with_lambda()
            {
                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);
                var returnValue = 0;
                s.Send(() => returnValue = TestMethod(), statName);

                _udp.AssertWasCalled(x => x.Send("name:500|ms"));
                Assert.That(returnValue, Is.EqualTo(5));
            }