Ejemplo n.º 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);
        }
Ejemplo n.º 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);
        }
Ejemplo n.º 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; });
        }
Ejemplo n.º 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; });
        }