public void Disconnect2() { transport1 .When(x => x.Disconnect()) .Do(x => { throw new PlatformNotSupportedException(); }); transport.Disconnect(); transport1.Received().Disconnect(); transport2.Received().Disconnect(); }
public void DisconnectNone() { transport1 .When(x => x.Disconnect()) .Do(x => { throw new PlatformNotSupportedException(); }); transport2 .When(x => x.Disconnect()) .Do(x => { throw new PlatformNotSupportedException(); }); Assert.Throws <PlatformNotSupportedException>(() => { transport.Disconnect(); }); }