Esempio n. 1
0
        public void StopWithExceptionRaisesOnError()
        {
            using (var connection = new Connection("http://fakeurl"))
            {
                var exception = new Exception();
                var onErrorCalled = false;

                connection.Error += error =>
                {
                    onErrorCalled = true;
                    Assert.Same(exception, error);
                };

                connection.Stop(exception, new TimeSpan(0));
                Assert.True(onErrorCalled);

                onErrorCalled = false;
                connection.Stop(exception);
                Assert.True(onErrorCalled);
            }
        }