Exemplo n.º 1
0
        public void send_increase_counter_counting_exception_fails_silently()
        {
            Statsd s = new Statsd(udp, _randomGenerator, _stopwatch);

            udp.Stub(x => x.Send(Arg <string> .Is.Anything)).Throw(new Exception());
            s.Send <Statsd.Counting, int>("counter", 5);
        }
        public void Setup()
        {
            _udp = MockRepository.GenerateMock<IStatsdUDP>();
            _udp.Stub(x => x.Send(Arg<string>.Is.Anything));

            _randomGenerator = MockRepository.GenerateMock<IRandomGenerator>();
            _randomGenerator.Stub(x => x.ShouldSend(Arg<double>.Is.Anything)).Return(true);
            _stopwatch = MockRepository.GenerateMock<IStopWatchFactory>();
        }
Exemplo n.º 3
0
        public void counting_exception_fails_silently()
        {
            var s = new Statsd(_udp, _randomGenerator, _stopwatch);

            _udp.Stub(x => x.Send(Arg <string> .Is.Anything)).Throw(new Exception());
            s.Send <Statsd.Counting>("counter", 5);
            Assert.Pass();
        }