-
Notifications
You must be signed in to change notification settings - Fork 73
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Integrate the cadl-ranch cases for encode and empty model cases (#1875)
* Update the test case * Update the encode cases * UPdate the changes * Update the logic * Update the logic * Improve the encode cases * Update the empty cases
- Loading branch information
Showing
27 changed files
with
982 additions
and
59 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
import { assert } from "chai"; | ||
import TypeModelEmptyClientFactory, { | ||
TypeModelEmptyClient | ||
} from "./generated/models/empty/src/index.js"; | ||
describe("TypeModelEmptyClient Rest Client", () => { | ||
let client: TypeModelEmptyClient; | ||
|
||
beforeEach(() => { | ||
client = TypeModelEmptyClientFactory({ | ||
allowInsecureConnection: true, | ||
retryOptions: { | ||
maxRetries: 0 | ||
} | ||
}); | ||
}); | ||
|
||
it(`should put empty model`, async () => { | ||
try { | ||
const result = await client.path("/type/model/empty/alone").put({ | ||
body: {} | ||
}); | ||
assert.strictEqual(result.status, "204"); | ||
} catch (err) { | ||
assert.fail(err as string); | ||
} | ||
}); | ||
|
||
it(`should get empty model`, async () => { | ||
try { | ||
const result = await client.path("/type/model/empty/alone").get(); | ||
assert.strictEqual(result.status, "200"); | ||
assert.isEmpty(result.body); | ||
} catch (err) { | ||
assert.fail(err as string); | ||
} | ||
}); | ||
|
||
it(`should post round-trip empty model`, async () => { | ||
try { | ||
const result = await client.path("/type/model/empty/round-trip").post({ | ||
body: {} | ||
}); | ||
assert.strictEqual(result.status, "200"); | ||
assert.isEmpty(result.body); | ||
} catch (err) { | ||
assert.fail(err as string); | ||
} | ||
}); | ||
}); |
Oops, something went wrong.