Extensions for IDbCommand
示例#1
0
        public void do_not_allow_name_to_be_null()
        {
            var    sut    = new FakeCommand();
            Action actual = () => CommandExtensions.AddParameter(sut, null, "arne");

            actual.ShouldThrow <ArgumentNullException>();
        }
        public void cant_operate_if_supplied_argument_do_not_specify_a_name()
        {
            var    sut    = new FakeCommand();
            Action actual = () => CommandExtensions.AddParameter(sut, null, "arne");

            actual.Should().Throw <ArgumentNullException>();
        }
示例#3
0
        public void convert_null_value_to_dbnull()
        {
            var sut = new FakeCommand();

            CommandExtensions.AddParameter(sut, "name", null);

            sut.Parameters[0].Value.Should().Be(DBNull.Value);
        }
示例#4
0
        public void add_created_parameter_to_command()
        {
            var sut = new FakeCommand();

            CommandExtensions.AddParameter(sut, "name", "arne");

            sut.Parameters[0].Value.Should().Be("arne");
            sut.Parameters[0].ParameterName.Should().Be("name");
        }