File tree Expand file tree Collapse file tree 1 file changed +40
-0
lines changed
eng/packages/http-client-csharp/generator/TestProjects/Spector.Tests/Http/Encode/Numeric Expand file tree Collapse file tree 1 file changed +40
-0
lines changed Original file line number Diff line number Diff line change 1+ // Copyright (c) Microsoft Corporation. All rights reserved.
2+ // Licensed under the MIT License.
3+
4+ using System . Threading . Tasks ;
5+ using Encode . Numeric ;
6+ using Encode . Numeric . Models ;
7+ using NUnit . Framework ;
8+
9+ namespace TestProjects . Spector . Tests . Http . Encode . Numeric
10+ {
11+ public class EncodeNumericTests : SpectorTestBase
12+ {
13+ [ SpectorTest ]
14+ public Task EncodeNumericPropertySafeintAsString ( ) => Test ( async ( host ) =>
15+ {
16+ var response = await new NumericClient ( host , null ) . GetPropertyClient ( ) . SafeintAsStringAsync ( new SafeintAsStringProperty ( 10000000000 ) ) ;
17+ Assert . AreEqual ( 200 , response . GetRawResponse ( ) . Status ) ;
18+ Assert . AreEqual ( 10000000000 , response . Value . Value ) ;
19+ } ) ;
20+
21+ [ SpectorTest ]
22+ public Task EncodeNumericPropertyUint32AsStringOptional ( ) => Test ( async ( host ) =>
23+ {
24+ var response = await new NumericClient ( host , null ) . GetPropertyClient ( ) . Uint32AsStringOptionalAsync ( new Uint32AsStringProperty ( )
25+ {
26+ Value = "1"
27+ } ) ;
28+ Assert . AreEqual ( 200 , response . GetRawResponse ( ) . Status ) ;
29+ Assert . AreEqual ( "1" , response . Value . Value ) ;
30+ } ) ;
31+
32+ [ SpectorTest ]
33+ public Task EncodeNumericPropertyUint8AsString ( ) => Test ( async ( host ) =>
34+ {
35+ var response = await new NumericClient ( host , null ) . GetPropertyClient ( ) . Uint8AsStringAsync ( new Uint8AsStringProperty ( 255 ) ) ;
36+ Assert . AreEqual ( 200 , response . GetRawResponse ( ) . Status ) ;
37+ Assert . AreEqual ( 255 , response . Value . Value ) ;
38+ } ) ;
39+ }
40+ }
You can’t perform that action at this time.
0 commit comments