Npgsql.Tests.ReaderOldSchemaTests.AllowDBNull C# (CSharp) Method

AllowDBNull() private method

private AllowDBNull ( ) : void
return void
        public void AllowDBNull()
        {
            using (var conn = OpenConnection())
            {
                conn.ExecuteNonQuery("CREATE TEMP TABLE data (nullable INTEGER, non_nullable INTEGER NOT NULL)");

                using (var cmd = new NpgsqlCommand("SELECT * FROM data", conn))
                using (var reader = cmd.ExecuteReader(CommandBehavior.SchemaOnly | CommandBehavior.KeyInfo))
                using (var metadata = reader.GetSchemaTable())
                {
                    foreach (DataRow row in metadata.Rows)
                    {
                        var isNullable = (bool)row["AllowDBNull"];
                        switch ((string)row["ColumnName"])
                        {
                        case "nullable":
                            Assert.IsTrue(isNullable);
                            continue;
                        case "non_nullable":
                            Assert.IsFalse(isNullable);
                            continue;
                        }
                    }
                }
            }
        }