File tree Expand file tree Collapse file tree 1 file changed +0
-51
lines changed Expand file tree Collapse file tree 1 file changed +0
-51
lines changed Original file line number Diff line number Diff line change @@ -79,57 +79,6 @@ public async Task ShouldWaitForTask()
79
79
) ;
80
80
}
81
81
82
- [ Fact ]
83
- public async Task ShouldWaitForApiKey ( )
84
- {
85
- var httpMock = new Mock < IHttpRequester > ( ) ;
86
- var client = new SearchClient ( new SearchConfig ( "test-app-id" , "test-api-key" ) , httpMock . Object ) ;
87
-
88
- httpMock
89
- . SetupSequence ( c =>
90
- c . SendRequestAsync (
91
- It . Is < Request > ( r => r . Uri . AbsolutePath . EndsWith ( "/1/keys/my-key" ) ) ,
92
- It . IsAny < TimeSpan > ( ) ,
93
- It . IsAny < TimeSpan > ( ) ,
94
- It . IsAny < CancellationToken > ( )
95
- )
96
- )
97
- // First call throw an exception
98
- . Throws ( new AlgoliaApiException ( "Oupss" , 0 ) )
99
- // Next call return a 404
100
- . Returns ( Task . FromResult ( new AlgoliaHttpResponse { HttpStatusCode = 404 } ) )
101
- // Third call return a Http 200
102
- . Returns (
103
- Task . FromResult (
104
- new AlgoliaHttpResponse
105
- {
106
- HttpStatusCode = 200 ,
107
- Body = new MemoryStream (
108
- Encoding . UTF8 . GetBytes (
109
- serializer . Serialize (
110
- new GetApiKeyResponse ( ) { CreatedAt = 12 , Acl = new List < Acl > ( ) }
111
- )
112
- )
113
- )
114
- }
115
- )
116
- ) ;
117
-
118
- await client . WaitForApiKeyAsync ( "my-key" , ApiKeyOperation . Add ) ;
119
-
120
- // Verify that the request has been called three times
121
- httpMock . Verify (
122
- m =>
123
- m . SendRequestAsync (
124
- It . Is < Request > ( r => r . Uri . AbsolutePath . EndsWith ( "/1/keys/my-key" ) ) ,
125
- It . IsAny < TimeSpan > ( ) ,
126
- It . IsAny < TimeSpan > ( ) ,
127
- It . IsAny < CancellationToken > ( )
128
- ) ,
129
- Times . Exactly ( 3 )
130
- ) ;
131
- }
132
-
133
82
[ Fact ]
134
83
public async Task ShouldBrowseObjects ( )
135
84
{
You can’t perform that action at this time.
0 commit comments