forked from Azure/autorest.typescript
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnonStringEnum.spec.ts
34 lines (29 loc) · 923 Bytes
/
nonStringEnum.spec.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
import { NonStringEnumClient } from "./generated/nonStringEnum/src";
import { assert } from "chai";
import { responseStatusChecker } from "../utils/responseStatusChecker";
describe("Swagger that needs no mapper", () => {
let client: NonStringEnumClient;
beforeEach(() => {
client = new NonStringEnumClient({ allowInsecureConnection: true });
});
it("should handle float with get", async () => {
const result = await client.float.get();
assert.equal(result.body, 429.1);
});
it("should handle int with get", async () => {
const result = await client.int.get();
assert.equal(result.body, 429);
});
it("should handle float with put", async () => {
await client.float.put({
...responseStatusChecker,
input: 200.4
});
});
it("should handle int with put", async () => {
await client.int.put({
...responseStatusChecker,
input: 200
});
});
});