Example #1
0
        public void Calling_Dispose_on_a_closed_channel_should_not_throw()
        {
            TestDelegate alreadyClosedChannel = () =>
            {
                var          subject = new WcfChannel <IEmptyClient>(TestUri);
                IEmptyClient client  = subject.Client;
                subject.Dispose();
                subject.Dispose();
            };

            Assert.DoesNotThrow(alreadyClosedChannel);
        }
Example #2
0
        public void Calling_Dispose_on_a_closed_channel_should_not_throw()
        {
            TestDelegate alreadyClosedChannel = () =>
            {
                var subject = new WcfChannel<IEmptyClient>(TestUri);
                IEmptyClient client = subject.Client;
                subject.Dispose();
                subject.Dispose();
            };

            Assert.DoesNotThrow(alreadyClosedChannel);
        }
Example #3
0
        public void Calling_the_client_after_dispose_should_throw_InvalidOperationException()
        {
            var subject = new WcfChannel<IEmptyClient>(TestUri);

            IEmptyClient client = subject.Client;
            subject.Dispose();

            Assert.Throws<InvalidOperationException>(() => { IEmptyClient secondAccess = subject.Client; });
        }
Example #4
0
        public void Calling_the_client_after_dispose_should_throw_InvalidOperationException()
        {
            var subject = new WcfChannel <IEmptyClient>(TestUri);

            IEmptyClient client = subject.Client;

            subject.Dispose();

            Assert.Throws <InvalidOperationException>(() => { IEmptyClient secondAccess = subject.Client; });
        }