예제 #1
0
 public void Wrapper_should_return_a_specified_client_instance()
 {
     using (var subject = new WcfChannel <IEmptyClient>(TestUri))
     {
         IEmptyClient client = subject.Client;
         Assert.IsInstanceOf <IEmptyClient>(subject.Client);
         Assert.IsNotNull(client);
     }
 }
예제 #2
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; });
        }
예제 #3
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);
        }