Example #1
0
        public void DbTypeInferredWhenNotSet()
        {
            var toTest = new InputOutputParameter("Foo", o => { }, 123M);

            var res = toTest.CreateDbDataParameter(CreateCommand());

            res.DbType.Should().Be(DbType.Decimal, "it should have been inferred");
            res.ParameterName.Should().Be("Foo", "it was passed in the constructor");
            res.Value.Should().Be(123M, "it was passed in the constructor");
            res.Direction.Should().Be(ParameterDirection.InputOutput, "it is an input/output parameter");
        }
Example #2
0
        public void SetsConstructorValuesOnParameter()
        {
            var toTest = new InputOutputParameter("Foo", o => { }, 123, DbType.Int32, 42, 31, 11);

            var res = toTest.CreateDbDataParameter(CreateCommand());

            res.DbType.Should().Be(DbType.Int32, "it was passed in the constructor");
            res.ParameterName.Should().Be("Foo", "it was passed in the constructor");
            res.Value.Should().Be(123, "it was passed in the constructor");
            res.Size.Should().Be(42, "it was passed in the constructor");
            res.Scale.Should().Be(31, "it was passed in the constructor");
            res.Precision.Should().Be(11, "it was passed in the constructor");
            res.Direction.Should().Be(ParameterDirection.InputOutput, "it is an input/output parameter");
        }