예제 #1
0
        public static void ServerUnsupportedOperationThrows()
        {
            using (AnonymousPipeServerStream server = new AnonymousPipeServerStream(PipeDirection.Out))
            {
                Assert.Throws <NotSupportedException>(() => server.Length);

                Assert.Throws <NotSupportedException>(() => server.SetLength(10L));

                Assert.Throws <NotSupportedException>(() => server.Position);

                Assert.Throws <NotSupportedException>(() => server.Position = 10L);

                Assert.Throws <NotSupportedException>(() => server.Seek(10L, System.IO.SeekOrigin.Begin));
            }
        }
예제 #2
0
        public static void ServerUnsupportedOperationThrows()
        {
            using (AnonymousPipeServerStream server = new AnonymousPipeServerStream(PipeDirection.Out))
            {
                Assert.Throws<NotSupportedException>(() => server.Length);

                Assert.Throws<NotSupportedException>(() => server.SetLength(10L));

                Assert.Throws<NotSupportedException>(() => server.Position);

                Assert.Throws<NotSupportedException>(() => server.Position = 10L);

                Assert.Throws<NotSupportedException>(() => server.Seek(10L, System.IO.SeekOrigin.Begin));
            }
        }