ConvertFromDbValue() 공개 메소드

Converts value at the specified index in the IDataReader into an instance of the specified type.
public ConvertFromDbValue ( IDataReader reader, int index, Type type ) : object
reader IDataReader The IDataReader containing the results.
index int The index of the record to read from the IDataReader.
type System.Type The type to convert result value to.
리턴 object
            public void AnArgumentNullExceptionShouldBeThrown()
            {
                var typeConverter = new XDocumentTypeConverter();

                var exception = Assert.Throws<ArgumentNullException>(
                    () => typeConverter.ConvertFromDbValue("foo", null));

                Assert.Equal("type", exception.ParamName);
            }
            public void AnArgumentNullExceptionShouldBeThrown()
            {
                var typeConverter = new XDocumentTypeConverter();

                var exception = Assert.Throws<ArgumentNullException>(
                    () => typeConverter.ConvertFromDbValue(new Mock<IDataReader>().Object, 0, null));

                Assert.Equal("type", exception.ParamName);
            }
            public void AnArgumentNullExceptionShouldBeThrown()
            {
                var typeConverter = new XDocumentTypeConverter();

                var exception = Assert.Throws<ArgumentNullException>(
                    () => typeConverter.ConvertFromDbValue(null, 0, typeof(XDocument)));

                Assert.Equal("reader", exception.ParamName);
            }