Exemplo n.º 1
0
        public void ClassConvertToThrowExceptionIfDisposed()
        {
            var format = new StringFormatTest("3");

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

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

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

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