ConvertFromDbValue() public méthode

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.
Résultat object
            public void AnArgumentNullExceptionShouldBeThrown()
            {
                var typeConverter = new EnumTypeConverter();

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

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

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

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

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

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