Beispiel #1
0
        public void String_properties_exposed_correctly()
        {
            var row =
                new object[]
            {
                "schema",
                "name",
                "retType",
                null,
                null,
                null,
                null,
                "paramName",
                "paramType",
                "paramDirection"
            };

            var view = new FunctionDetailsV1RowView(row);

            Assert.Equal("schema", view.Schema);
            Assert.Equal("name", view.ProcedureName);
            Assert.Equal("retType", view.ReturnType);
            Assert.Equal("paramName", view.ParameterName);
            Assert.Equal("paramType", view.ParameterType);
            Assert.Equal("paramDirection", view.ProcParameterMode);
        }
        public void String_properties_exposed_correctly()
        {
            var row =
                new object[]
                    {
                        "schema",
                        "name",
                        "retType",
                        null,
                        null,
                        null,
                        null,
                        "paramName",
                        "paramType",
                        "paramDirection"
                    };

            var view = new FunctionDetailsV1RowView(row);

            Assert.Equal("schema", view.Schema);
            Assert.Equal("name", view.ProcedureName);
            Assert.Equal("retType", view.ReturnType);
            Assert.Equal("paramName", view.ParameterName);
            Assert.Equal("paramType", view.ParameterType);
            Assert.Equal("paramDirection", view.ProcParameterMode);
        }
Beispiel #3
0
        public void Catalog_and_IsTvf_return_default_values()
        {
            var view =
                new FunctionDetailsV1RowView(Enumerable.Repeat(new object(), 10).ToArray());

            Assert.Null(view.Catalog);
            Assert.False(view.IsTvf);
        }
Beispiel #4
0
        public void IsParameterXXXNull_properties_return_false_for_non_DBNull_values()
        {
            var view =
                new FunctionDetailsV1RowView(Enumerable.Repeat("test", 10).ToArray());

            Assert.False(view.IsParameterNameNull);
            Assert.False(view.IsParameterTypeNull);
            Assert.False(view.IsParameterModeNull);
        }
Beispiel #5
0
        public void IsParameterXXXNull_properties_return_true_for_DBNull_values()
        {
            var view =
                new FunctionDetailsV1RowView(Enumerable.Repeat(DBNull.Value, 10).ToArray());

            Assert.True(view.IsParameterNameNull);
            Assert.True(view.IsParameterTypeNull);
            Assert.True(view.IsParameterModeNull);
        }
Beispiel #6
0
        public void IsBuiltIn_property_exposed_correctly()
        {
            const int isBuiltInIndex = 5;
            var       row            = new object[10];
            var       view           = new FunctionDetailsV1RowView(row);

            row[isBuiltInIndex] = false;
            Assert.False(view.IsBuiltIn);
            row[isBuiltInIndex] = true;
            Assert.True(view.IsBuiltIn);
        }
Beispiel #7
0
        public void IsComposable_property_exposed_correctly()
        {
            const int isComposableIndex = 4;
            var       row  = new object[10];
            var       view = new FunctionDetailsV1RowView(row);

            row[isComposableIndex] = false;
            Assert.False(view.IsComposable);
            row[isComposableIndex] = true;
            Assert.True(view.IsComposable);
        }
        public void IsBuiltIn_property_exposed_correctly()
        {
            const int isBuiltInIndex = 5;
            var row = new object[10];
            var view = new FunctionDetailsV1RowView(row);

            row[isBuiltInIndex] = false;
            Assert.False(view.IsBuiltIn);
            row[isBuiltInIndex] = true;
            Assert.True(view.IsBuiltIn);
        }
        public void IsComposable_property_exposed_correctly()
        {
            const int isComposableIndex = 4;
            var row = new object[10];
            var view = new FunctionDetailsV1RowView(row);

            row[isComposableIndex] = false;
            Assert.False(view.IsComposable);
            row[isComposableIndex] = true;
            Assert.True(view.IsComposable);
        }
Beispiel #10
0
        public void DbNull_converted_to_default_values()
        {
            var view =
                new FunctionDetailsV1RowView(Enumerable.Repeat(DBNull.Value, 10).ToArray());

            Assert.Null(view.Catalog);
            Assert.Null(view.Schema);
            Assert.Null(view.ProcedureName);
            Assert.Null(view.ReturnType);
            Assert.False(view.IsIsAggregate);
            Assert.False(view.IsBuiltIn);
            Assert.False(view.IsComposable);
            Assert.False(view.IsNiladic);
            Assert.False(view.IsTvf);
            Assert.Null(view.ParameterName);
            Assert.Null(view.ParameterType);
            Assert.Null(view.ProcParameterMode);
        }
Beispiel #11
0
        private static void TryGetParameterMode_test_helper(object paramDirection, bool successExpected, ParameterMode expectedMode)
        {
            var row =
                new[]
            {
                "schema",
                "name",
                "retType",
                null,
                null,
                null,
                null,
                "paramName",
                "paramType",
                paramDirection
            };

            ParameterMode actualMode;
            var           success = new FunctionDetailsV1RowView(row).TryGetParameterMode(out actualMode);

            Assert.Equal(successExpected, success);
            Assert.Equal(expectedMode, actualMode);
        }
        public void Catalog_and_IsTvf_return_default_values()
        {
            var view =
                new FunctionDetailsV1RowView(Enumerable.Repeat(new object(), 10).ToArray());

            Assert.Null(view.Catalog);
            Assert.False(view.IsTvf);
        }
        private static void TryGetParameterMode_test_helper(object paramDirection, bool successExpected, ParameterMode expectedMode)
        {
            var row =
                new[]
                    {
                        "schema",
                        "name",
                        "retType",
                        null,
                        null,
                        null,
                        null,
                        "paramName",
                        "paramType",
                        paramDirection
                    };

            ParameterMode actualMode;
            var success = new FunctionDetailsV1RowView(row).TryGetParameterMode(out actualMode);
            Assert.Equal(successExpected, success);
            Assert.Equal(expectedMode, actualMode);
        }
        public void IsParameterXXXNull_properties_return_false_for_non_DBNull_values()
        {
            var view =
                new FunctionDetailsV1RowView(Enumerable.Repeat("test", 10).ToArray());

            Assert.False(view.IsParameterNameNull);
            Assert.False(view.IsParameterTypeNull);
            Assert.False(view.IsParameterModeNull);
        }
        public void IsParameterXXXNull_properties_return_true_for_DBNull_values()
        {
            var view =
                new FunctionDetailsV1RowView(Enumerable.Repeat(DBNull.Value, 10).ToArray());

            Assert.True(view.IsParameterNameNull);
            Assert.True(view.IsParameterTypeNull);
            Assert.True(view.IsParameterModeNull);
        }
        public void DbNull_converted_to_default_values()
        {
            var view =
                new FunctionDetailsV1RowView(Enumerable.Repeat(DBNull.Value, 10).ToArray());

            Assert.Null(view.Catalog);
            Assert.Null(view.Schema);
            Assert.Null(view.ProcedureName);
            Assert.Null(view.ReturnType);
            Assert.False(view.IsIsAggregate);
            Assert.False(view.IsBuiltIn);
            Assert.False(view.IsComposable);
            Assert.False(view.IsNiladic);
            Assert.False(view.IsTvf);
            Assert.Null(view.ParameterName);
            Assert.Null(view.ParameterType);
            Assert.Null(view.ProcParameterMode);
        }