@@ -46,8 +46,8 @@ public async Task TestDefaultUserAgentHeader() {
4646 var translator = new Translator (
4747 AuthKey ,
4848 new TranslatorOptions {
49- ClientFactory = ( ) =>
50- new HttpClientAndDisposeFlag { HttpClient = new HttpClient ( mockHandler ) , DisposeClient = true , }
49+ ClientFactory = ( ) =>
50+ new HttpClientAndDisposeFlag { HttpClient = new HttpClient ( mockHandler ) , DisposeClient = true , }
5151 } ) ;
5252 var usage = await translator . GetUsageAsync ( ) ;
5353 Assert . Single ( mockHandler . requests ) ;
@@ -63,9 +63,9 @@ public async Task TestOptInUserAgentHeader() {
6363 var translator = new Translator (
6464 AuthKey ,
6565 new TranslatorOptions {
66- sendPlatformInfo = true ,
67- ClientFactory = ( ) =>
68- new HttpClientAndDisposeFlag { HttpClient = new HttpClient ( mockHandler ) , DisposeClient = true , }
66+ sendPlatformInfo = true ,
67+ ClientFactory = ( ) =>
68+ new HttpClientAndDisposeFlag { HttpClient = new HttpClient ( mockHandler ) , DisposeClient = true , }
6969 } ) ;
7070 var usage = await translator . GetUsageAsync ( ) ;
7171 Assert . Single ( mockHandler . requests ) ;
@@ -81,9 +81,9 @@ public async Task TestOptOutUserAgentHeader() {
8181 var translator = new Translator (
8282 AuthKey ,
8383 new TranslatorOptions {
84- sendPlatformInfo = false ,
85- ClientFactory = ( ) =>
86- new HttpClientAndDisposeFlag { HttpClient = new HttpClient ( mockHandler ) , DisposeClient = true , }
84+ sendPlatformInfo = false ,
85+ ClientFactory = ( ) =>
86+ new HttpClientAndDisposeFlag { HttpClient = new HttpClient ( mockHandler ) , DisposeClient = true , }
8787 } ) ;
8888 var usage = await translator . GetUsageAsync ( ) ;
8989 Assert . Single ( mockHandler . requests ) ;
@@ -99,10 +99,10 @@ public async Task TestDefaultUserAgentHeaderWithAppInfo() {
9999 var translator = new Translator (
100100 AuthKey ,
101101 new TranslatorOptions {
102- sendPlatformInfo = true ,
103- appInfo = new AppInfo { AppName = "my-dotnet-test-app" , AppVersion = "1.2.3" } ,
104- ClientFactory = ( ) =>
105- new HttpClientAndDisposeFlag { HttpClient = new HttpClient ( mockHandler ) , DisposeClient = true , }
102+ sendPlatformInfo = true ,
103+ appInfo = new AppInfo { AppName = "my-dotnet-test-app" , AppVersion = "1.2.3" } ,
104+ ClientFactory = ( ) =>
105+ new HttpClientAndDisposeFlag { HttpClient = new HttpClient ( mockHandler ) , DisposeClient = true , }
106106 } ) ;
107107 var usage = await translator . GetUsageAsync ( ) ;
108108 Assert . Single ( mockHandler . requests ) ;
@@ -119,10 +119,10 @@ public async Task TestOptInUserAgentHeaderWithAppInfo() {
119119 var translator = new Translator (
120120 AuthKey ,
121121 new TranslatorOptions {
122- sendPlatformInfo = true ,
123- appInfo = new AppInfo { AppName = "my-dotnet-test-app" , AppVersion = "1.2.3" } ,
124- ClientFactory = ( ) =>
125- new HttpClientAndDisposeFlag { HttpClient = new HttpClient ( mockHandler ) , DisposeClient = true , }
122+ sendPlatformInfo = true ,
123+ appInfo = new AppInfo { AppName = "my-dotnet-test-app" , AppVersion = "1.2.3" } ,
124+ ClientFactory = ( ) =>
125+ new HttpClientAndDisposeFlag { HttpClient = new HttpClient ( mockHandler ) , DisposeClient = true , }
126126 } ) ;
127127 var usage = await translator . GetUsageAsync ( ) ;
128128 Assert . Single ( mockHandler . requests ) ;
@@ -139,10 +139,10 @@ public async Task TestOptOutUserAgentHeaderWithAppInfo() {
139139 var translator = new Translator (
140140 AuthKey ,
141141 new TranslatorOptions {
142- sendPlatformInfo = false ,
143- appInfo = new AppInfo { AppName = "my-dotnet-test-app" , AppVersion = "1.2.3" } ,
144- ClientFactory = ( ) =>
145- new HttpClientAndDisposeFlag { HttpClient = new HttpClient ( mockHandler ) , DisposeClient = true , }
142+ sendPlatformInfo = false ,
143+ appInfo = new AppInfo { AppName = "my-dotnet-test-app" , AppVersion = "1.2.3" } ,
144+ ClientFactory = ( ) =>
145+ new HttpClientAndDisposeFlag { HttpClient = new HttpClient ( mockHandler ) , DisposeClient = true , }
146146 } ) ;
147147 var usage = await translator . GetUsageAsync ( ) ;
148148 Assert . Single ( mockHandler . requests ) ;
@@ -248,13 +248,14 @@ public async Task TestProxyUsage() {
248248 nameof ( TestUsageNoResponse ) ,
249249 new SessionOptions { ExpectProxy = true } ,
250250 new TranslatorOptions {
251- ServerUrl = ServerUrl ,
252- ClientFactory =
251+ ServerUrl = ServerUrl ,
252+ ClientFactory =
253253 ( ) => {
254254 var handler = new HttpClientHandler ( ) { Proxy = new WebProxy ( ProxyUrl ) , UseProxy = true , } ;
255255
256256 return new HttpClientAndDisposeFlag {
257- HttpClient = new HttpClient ( handler ) , DisposeClient = true ,
257+ HttpClient = new HttpClient ( handler ) ,
258+ DisposeClient = true ,
258259 } ;
259260 }
260261 } ) ;
@@ -269,7 +270,8 @@ public async Task TestUsageNoResponse() {
269270 nameof ( TestUsageNoResponse ) ,
270271 new SessionOptions { NoResponse = 2 } ,
271272 new TranslatorOptions {
272- PerRetryConnectionTimeout = TimeSpan . FromMilliseconds ( 1 ) , MaximumNetworkRetries = 0
273+ PerRetryConnectionTimeout = TimeSpan . FromMilliseconds ( 1 ) ,
274+ MaximumNetworkRetries = 0
273275 } ) ;
274276
275277 await Assert . ThrowsAsync < ConnectionException > ( ( ) => translator . GetUsageAsync ( ) ) ;
@@ -343,7 +345,9 @@ public async Task TestUsageTeamDocumentLimit() {
343345 var translator = CreateTestTranslatorWithMockSession (
344346 nameof ( TestUsageOverrun ) ,
345347 new SessionOptions {
346- InitCharacterLimit = 0 , InitDocumentLimit = 0 , InitTeamDocumentLimit = teamDocumentLimit
348+ InitCharacterLimit = 0 ,
349+ InitDocumentLimit = 0 ,
350+ InitTeamDocumentLimit = teamDocumentLimit
347351 } ,
348352 randomAuthKey : true ) ;
349353
0 commit comments