1
+ #pragma warning disable CS0618 , CS0612 // allow testing obsolete methods
1
2
using Xunit ;
2
3
using StackExchange . Redis ;
3
4
using NRedisStack . RedisStackCommands ;
@@ -2807,7 +2808,7 @@ public void TestProfileSearch(string endpointId)
2807
2808
2808
2809
var profile = ft . ProfileOnSearch ( index , new Query ( "foo" ) ) ;
2809
2810
// Iterators profile={Type=TEXT, Time=0.0, Term=foo, Counter=1, Size=1}
2810
- var info = ( RedisResult [ ] ) profile . Item2 . Info ;
2811
+ var info = ( RedisResult [ ] ) profile . Item2 . Info ! ;
2811
2812
int shardsIndex = Array . FindIndex ( info , item => item . ToString ( ) == "Shards" ) ;
2812
2813
int coordinatorIndex = Array . FindIndex ( info , item => item . ToString ( ) == "Coordinator" ) ;
2813
2814
CustomAssertions . GreaterThan ( shardsIndex , - 1 ) ;
@@ -2829,7 +2830,7 @@ public async Task TestProfileSearchAsync(string endpointId)
2829
2830
new HashEntry ( "t2" , "bar" ) } ) ;
2830
2831
2831
2832
var profile = await ft . ProfileOnSearchAsync ( index , new Query ( "foo" ) ) ;
2832
- var info = ( RedisResult [ ] ) profile . Item2 . Info ;
2833
+ var info = ( RedisResult [ ] ) profile . Item2 . Info ! ;
2833
2834
int shardsIndex = Array . FindIndex ( info , item => item . ToString ( ) == "Shards" ) ;
2834
2835
int coordinatorIndex = Array . FindIndex ( info , item => item . ToString ( ) == "Coordinator" ) ;
2835
2836
CustomAssertions . GreaterThan ( shardsIndex , - 1 ) ;
@@ -2889,7 +2890,7 @@ public void TestProfile(string endpointId)
2889
2890
var q = new Query ( "hello|world" ) . SetNoContent ( ) ;
2890
2891
var profileSearch = ft . ProfileOnSearch ( index , q ) ;
2891
2892
var searchRes = profileSearch . Item1 ;
2892
- var searchDet = ( RedisResult [ ] ) profileSearch . Item2 . Info ;
2893
+ var searchDet = ( RedisResult [ ] ) profileSearch . Item2 . Info ! ;
2893
2894
2894
2895
Assert . Equal ( 2 , searchRes . Documents . Count ) ;
2895
2896
int shardsIndex = Array . FindIndex ( searchDet , item => item . ToString ( ) == "Shards" ) ;
@@ -2901,7 +2902,7 @@ public void TestProfile(string endpointId)
2901
2902
var aggReq = new AggregationRequest ( "*" ) . Load ( FieldName . Of ( "t" ) ) . Apply ( "startswith(@t, 'hel')" , "prefix" ) ;
2902
2903
var profileAggregate = ft . ProfileOnAggregate ( index , aggReq ) ;
2903
2904
var aggregateRes = profileAggregate . Item1 ;
2904
- var aggregateDet = ( RedisResult [ ] ) profileAggregate . Item2 . Info ;
2905
+ var aggregateDet = ( RedisResult [ ] ) profileAggregate . Item2 . Info ! ;
2905
2906
2906
2907
Assert . Equal ( 2 , aggregateRes . TotalResults ) ;
2907
2908
shardsIndex = Array . FindIndex ( aggregateDet , item => item . ToString ( ) == "Shards" ) ;
@@ -2925,7 +2926,7 @@ public async Task TestProfileAsync(string endpointId)
2925
2926
var q = new Query ( "hello|world" ) . SetNoContent ( ) ;
2926
2927
var profileSearch = await ft . ProfileOnSearchAsync ( index , q ) ;
2927
2928
var searchRes = profileSearch . Item1 ;
2928
- var searchDet = ( RedisResult [ ] ) profileSearch . Item2 . Info ;
2929
+ var searchDet = ( RedisResult [ ] ) profileSearch . Item2 . Info ! ;
2929
2930
2930
2931
Assert . Equal ( 2 , searchRes . Documents . Count ) ;
2931
2932
int shardsIndex = Array . FindIndex ( searchDet , item => item . ToString ( ) == "Shards" ) ;
@@ -2937,7 +2938,7 @@ public async Task TestProfileAsync(string endpointId)
2937
2938
var aggReq = new AggregationRequest ( "*" ) . Load ( FieldName . Of ( "t" ) ) . Apply ( "startswith(@t, 'hel')" , "prefix" ) ;
2938
2939
var profileAggregate = await ft . ProfileOnAggregateAsync ( index , aggReq ) ;
2939
2940
var aggregateRes = profileAggregate . Item1 ;
2940
- var aggregateDet = ( RedisResult [ ] ) profileAggregate . Item2 . Info ;
2941
+ var aggregateDet = ( RedisResult [ ] ) profileAggregate . Item2 . Info ! ;
2941
2942
2942
2943
Assert . Equal ( 2 , aggregateRes . TotalResults ) ;
2943
2944
shardsIndex = Array . FindIndex ( aggregateDet , item => item . ToString ( ) == "Shards" ) ;
@@ -3021,7 +3022,7 @@ public void TestProfileIssue306(string endpointId)
3021
3022
var q = new Query ( "hello|world" ) . SetNoContent ( ) ;
3022
3023
var profileSearch = ft . ProfileOnSearch ( index , q ) ;
3023
3024
var searchRes = profileSearch . Item1 ;
3024
- var searchDet = ( RedisResult [ ] ) profileSearch . Item2 . Info ;
3025
+ var searchDet = ( RedisResult [ ] ) profileSearch . Item2 . Info ! ;
3025
3026
3026
3027
CustomAssertions . GreaterThan ( searchDet . Length , 3 ) ;
3027
3028
Assert . Equal ( 2 , searchRes . Documents . Count ) ;
@@ -3031,7 +3032,7 @@ public void TestProfileIssue306(string endpointId)
3031
3032
var aggReq = new AggregationRequest ( "*" ) . Load ( FieldName . Of ( "t" ) ) . Apply ( "startswith(@t, 'hel')" , "prefix" ) ;
3032
3033
var profileAggregate = ft . ProfileOnAggregate ( index , aggReq ) ;
3033
3034
var aggregateRes = profileAggregate . Item1 ;
3034
- var aggregateDet = ( RedisResult [ ] ) profileAggregate . Item2 . Info ;
3035
+ var aggregateDet = ( RedisResult [ ] ) profileAggregate . Item2 . Info ! ;
3035
3036
CustomAssertions . GreaterThan ( aggregateDet . Length , 3 ) ;
3036
3037
Assert . Equal ( 2 , aggregateRes . TotalResults ) ;
3037
3038
}
@@ -3051,7 +3052,7 @@ public async Task TestProfileAsyncIssue306(string endpointId)
3051
3052
var q = new Query ( "hello|world" ) . SetNoContent ( ) ;
3052
3053
var profileSearch = await ft . ProfileOnSearchAsync ( index , q ) ;
3053
3054
var searchRes = profileSearch . Item1 ;
3054
- var searchDet = ( RedisResult [ ] ) profileSearch . Item2 . Info ;
3055
+ var searchDet = ( RedisResult [ ] ) profileSearch . Item2 . Info ! ;
3055
3056
3056
3057
CustomAssertions . GreaterThan ( searchDet . Length , 3 ) ;
3057
3058
Assert . Equal ( 2 , searchRes . Documents . Count ) ;
@@ -3060,7 +3061,7 @@ public async Task TestProfileAsyncIssue306(string endpointId)
3060
3061
var aggReq = new AggregationRequest ( "*" ) . Load ( FieldName . Of ( "t" ) ) . Apply ( "startswith(@t, 'hel')" , "prefix" ) ;
3061
3062
var profileAggregate = await ft . ProfileOnAggregateAsync ( index , aggReq ) ;
3062
3063
var aggregateRes = profileAggregate . Item1 ;
3063
- var aggregateDet = ( RedisResult [ ] ) profileAggregate . Item2 . Info ;
3064
+ var aggregateDet = ( RedisResult [ ] ) profileAggregate . Item2 . Info ! ;
3064
3065
CustomAssertions . GreaterThan ( aggregateDet . Length , 3 ) ;
3065
3066
Assert . Equal ( 2 , aggregateRes . TotalResults ) ;
3066
3067
}
@@ -3438,15 +3439,15 @@ public void TestDocumentLoad_Issue352()
3438
3439
/// </summary>
3439
3440
[ SkippableTheory ]
3440
3441
[ MemberData ( nameof ( EndpointsFixture . Env . StandaloneOnly ) , MemberType = typeof ( EndpointsFixture . Env ) ) ]
3441
- public async void TestDocumentLoadWithDB_Issue352 ( string endpointId )
3442
+ public async Task TestDocumentLoadWithDB_Issue352 ( string endpointId )
3442
3443
{
3443
3444
IDatabase db = GetCleanDatabase ( endpointId ) ;
3444
3445
var ft = db . FT ( ) ;
3445
3446
3446
3447
Schema sc = new Schema ( ) . AddTextField ( "firstText" , 1.0 ) . AddTextField ( "lastText" , 1.0 ) . AddNumericField ( "ageNumeric" ) ;
3447
3448
Assert . True ( ft . Create ( index , FTCreateParams . CreateParams ( ) , sc ) ) ;
3448
3449
3449
- Document droppedDocument = null ;
3450
+ Document ? droppedDocument = null ;
3450
3451
int numberOfAttempts = 0 ;
3451
3452
do
3452
3453
{
0 commit comments