예제 #1
0
        public void ClassConvertToThrowExceptionIfDisposed()
        {
            var format = new StringFormatTest("3");

            format.Dispose();
            Assert.Throws <ObjectDisposedException>(() => format.ConvertTo(typeof(int)));
        }
예제 #2
0
        public void ClassConvertToGenericThrowExceptionIfDisposed()
        {
            var format = new StringFormatTest("3");

            format.Dispose();
            Assert.Throws <ObjectDisposedException>(() => format.ConvertTo <int>());
        }
예제 #3
0
        public void DisposeChangesDisposed()
        {
            var format = new StringFormatTest("3");

            Assert.IsFalse(format.Disposed);
            format.Dispose();
            Assert.IsTrue(format.Disposed);
        }
예제 #4
0
        public void ClassConvertWithThrowsExceptionIfDisposed()
        {
            var format    = new StringFormatTest("3");
            var converter = new FormatTestDuplicatedConverter2();

            format.Dispose();
            Assert.Throws <ObjectDisposedException>(() =>
                                                    format.ConvertWith <short>(converter));
        }