Skip to content

Commit 8b63d7b

Browse files
chore: adopt http/encode/numberic (Azure#49524)
1 parent bf66606 commit 8b63d7b

File tree

1 file changed

+40
-0
lines changed
  • eng/packages/http-client-csharp/generator/TestProjects/Spector.Tests/Http/Encode/Numeric

1 file changed

+40
-0
lines changed
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
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+
}

0 commit comments

Comments
 (0)