@@ -29,13 +29,8 @@ public class GetSchemaTableTests
2929 {
3030 private readonly AllTypesTableFixture _fixture ;
3131
32- // On emulator, the types defined in SchemaTestUnsupportedData are skipped from tests.
3332 // The table also contains the `K` column that is the primary key.
34- internal int ExpectedRowCountOnEmulator => SchemaTestData . Count ( ) + 1 ;
35-
36- // On production, the types defined in both SchemaTestUnsupportedData and SchemaTestData are executed.
37- // The table also contains the `K` column that is the primary key.
38- internal int ExpectedRowCountOnProduction => SchemaTestUnsupportedData . Count ( ) + SchemaTestData . Count ( ) + 1 ;
33+ internal int ExpectedRowCount => SchemaTestData . Count ( ) + 1 ;
3934
4035 public GetSchemaTableTests ( AllTypesTableFixture fixture ) => _fixture = fixture ;
4136
@@ -53,39 +48,29 @@ public async Task GetSchemaTable_Default_ReturnsNull()
5348 }
5449
5550 // TODO: xUnit v3 supports traits for DataAttributes. Use that instead of Skip when we migrate.
56- [ SkippableTheory ]
51+ [ Theory ]
5752 [ MemberData ( nameof ( SchemaTestData ) ) ]
58- [ MemberData ( nameof ( SchemaTestUnsupportedData ) ) ]
5953 public async Task GetSchemaTable_WithFlagEnabled_ReturnsSchema ( string columnName , System . Type type , SpannerDbType spannerDbType )
6054 {
61- MaybeSkipIfOnEmulator ( spannerDbType ) ;
6255 string selectQuery = $ "SELECT { columnName } FROM { _fixture . TableName } ";
6356 await GetSchemaTable_WithFlagEnabled_ReturnsSchema_Impl ( columnName , type , spannerDbType , _fixture . ConnectionString , selectQuery ) ;
6457 }
6558
66- // These SpannerDbTypes are not supported on emulator.
67- public static TheoryData < string , System . Type , SpannerDbType > SchemaTestUnsupportedData { get ; } =
68- new TheoryData < string , System . Type , SpannerDbType >
69- {
70- { "Float32Value" , typeof ( float ) , SpannerDbType . Float32 } ,
71- { "Float32ArrayValue" , typeof ( List < float > ) , SpannerDbType . ArrayOf ( SpannerDbType . Float32 ) } ,
72- { "JsonValue" , typeof ( string ) , SpannerDbType . Json } ,
73- { "JsonArrayValue" , typeof ( List < string > ) , SpannerDbType . ArrayOf ( SpannerDbType . Json ) } ,
74- } ;
75-
7659 // These SpannerDbTypes are supported on emulator.
7760 public static TheoryData < string , System . Type , SpannerDbType > SchemaTestData { get ; } =
7861 new TheoryData < string , System . Type , SpannerDbType >
7962 {
8063 // Base types.
8164 { "BoolValue" , typeof ( bool ) , SpannerDbType . Bool } ,
8265 { "Int64Value" , typeof ( long ) , SpannerDbType . Int64 } ,
66+ { "Float32Value" , typeof ( float ) , SpannerDbType . Float32 } ,
8367 { "Float64Value" , typeof ( double ) , SpannerDbType . Float64 } ,
8468 { "NumericValue" , typeof ( SpannerNumeric ) , SpannerDbType . Numeric } ,
8569 { "StringValue" , typeof ( string ) , SpannerDbType . String } ,
8670 { "BytesValue" , typeof ( byte [ ] ) , SpannerDbType . Bytes } ,
8771 { "TimestampValue" , typeof ( DateTime ) , SpannerDbType . Timestamp } ,
8872 { "DateValue" , typeof ( DateTime ) , SpannerDbType . Date } ,
73+ { "JsonValue" , typeof ( string ) , SpannerDbType . Json } ,
8974 { "ProtobufDurationValue" , typeof ( Value ) , SpannerDbType . FromClrType ( typeof ( Duration ) ) } ,
9075 { "ProtobufRectangleValue" , typeof ( Value ) , SpannerDbType . FromClrType ( typeof ( Rectangle ) ) } ,
9176 { "ProtobufValueValue" , typeof ( Value ) , SpannerDbType . FromClrType ( typeof ( Value ) ) } ,
@@ -95,13 +80,15 @@ public async Task GetSchemaTable_WithFlagEnabled_ReturnsSchema(string columnName
9580 // Array types.
9681 { "BoolArrayValue" , typeof ( List < bool > ) , SpannerDbType . ArrayOf ( SpannerDbType . Bool ) } ,
9782 { "Int64ArrayValue" , typeof ( List < long > ) , SpannerDbType . ArrayOf ( SpannerDbType . Int64 ) } ,
83+ { "Float32ArrayValue" , typeof ( List < float > ) , SpannerDbType . ArrayOf ( SpannerDbType . Float32 ) } ,
9884 { "Float64ArrayValue" , typeof ( List < double > ) , SpannerDbType . ArrayOf ( SpannerDbType . Float64 ) } ,
9985 { "NumericArrayValue" , typeof ( List < SpannerNumeric > ) , SpannerDbType . ArrayOf ( SpannerDbType . Numeric ) } ,
10086 { "StringArrayValue" , typeof ( List < string > ) , SpannerDbType . ArrayOf ( SpannerDbType . String ) } ,
10187 { "Base64ArrayValue" , typeof ( List < byte [ ] > ) , SpannerDbType . ArrayOf ( SpannerDbType . Bytes ) } ,
10288 { "BytesArrayValue" , typeof ( List < byte [ ] > ) , SpannerDbType . ArrayOf ( SpannerDbType . Bytes ) } ,
10389 { "TimestampArrayValue" , typeof ( List < DateTime > ) , SpannerDbType . ArrayOf ( SpannerDbType . Timestamp ) } ,
10490 { "DateArrayValue" , typeof ( List < DateTime > ) , SpannerDbType . ArrayOf ( SpannerDbType . Date ) } ,
91+ { "JsonArrayValue" , typeof ( List < string > ) , SpannerDbType . ArrayOf ( SpannerDbType . Json ) } ,
10592 { "ProtobufDurationArrayValue" , typeof ( List < Value > ) , SpannerDbType . ArrayOf ( SpannerDbType . FromClrType ( typeof ( Duration ) ) ) } ,
10693 { "ProtobufRectangleArrayValue" , typeof ( List < Value > ) , SpannerDbType . ArrayOf ( SpannerDbType . FromClrType ( typeof ( Rectangle ) ) ) } ,
10794 { "ProtobufValueArrayValue" , typeof ( List < Value > ) , SpannerDbType . ArrayOf ( SpannerDbType . FromClrType ( typeof ( Value ) ) ) } ,
@@ -138,7 +125,7 @@ public async Task GetSchemaTable_WithFlagEnabled_ReturnsColumnOrdinals()
138125 using ( var reader = await command . ExecuteReaderAsync ( ) )
139126 {
140127 var table = reader . GetSchemaTable ( ) ;
141- var expectedRowCount = _fixture . RunningOnEmulator ? ExpectedRowCountOnEmulator : ExpectedRowCountOnProduction ;
128+ var expectedRowCount = ExpectedRowCount ;
142129 Assert . Equal ( expectedRowCount , table . Rows . Count ) ;
143130 for ( var ordinal = 1 ; ordinal < expectedRowCount ; ordinal ++ )
144131 {
@@ -148,9 +135,5 @@ public async Task GetSchemaTable_WithFlagEnabled_ReturnsColumnOrdinals()
148135 }
149136 }
150137 }
151-
152- private void MaybeSkipIfOnEmulator ( SpannerDbType spannerDbType ) =>
153- Skip . If ( _fixture . RunningOnEmulator && SchemaTestUnsupportedData . Any ( data => spannerDbType . Equals ( data [ 2 ] ) ) ,
154- $ "The emulator does not support { spannerDbType } .") ;
155138 }
156139}
0 commit comments