Skip to content

Commit

Permalink
Merge pull request #760 from sarangan12/Issue750
Browse files Browse the repository at this point in the history
Add coverage for missing body-array test server scenarios
  • Loading branch information
sarangan12 authored Oct 13, 2020
2 parents a0e30ef + dfe54d4 commit 2633e09
Showing 1 changed file with 72 additions and 0 deletions.
72 changes: 72 additions & 0 deletions test/integration/bodyArray.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -446,6 +446,78 @@ describe("Integration tests for BodyArrayClient", () => {
});
});

describe("#getArrayComplex", () => {
it("returns a list of complex arrays", async () => {
const response = await client.array.getComplexValid();
expect(response).to.deep.equal([
{ integer: 1, string: "2" },
{ integer: 3, string: "4" },
{ integer: 5, string: "6" }
]);
expect(response._response.status).to.equal(
200,
`Unexpected status code.`
);
});
});

describe("#getArrayDateTimeWithInvalidChars", () => {
it("returns an invalid date in the array", async () => {
const response = await client.array.getDateTimeInvalidChars();
expect(response).to.deep.equal([
new Date("2000-12-01T00:00:01.000Z"),
new Date("date-time") //Invalid Value
]);
expect(response._response.status).to.equal(
200,
`Unexpected status code.`
);
});
});

describe("#getArrayDateTimeWithNull", () => {
it("returns null date in the array", async () => {
const response = await client.array.getDateTimeInvalidNull();
expect(response).to.deep.equal([
new Date("2000-12-01T00:00:01.000Z"),
null
]);
expect(response._response.status).to.equal(
200,
`Unexpected status code.`
);
});
});

describe("#putArrayBooleanValid", () => {
it("sends an array of boolean values successfully", async () => {
const response = await client.array.putBooleanTfft([
true,
false,
false,
true
]);
expect(response._response.status).to.equal(
200,
`Unexpected status code.`
);
});
});

describe("#putArrayComplexValid", () => {
it("sends an array of complex objects successfully", async () => {
const response = await client.array.putComplexValid([
{ integer: 1, string: "2" },
{ integer: 3, string: "4" },
{ integer: 5, string: "6" }
]);
expect(response._response.status).to.equal(
200,
`Unexpected status code.`
);
});
});

describe("#getDictionaryValid", () => {
it("returns an array of objects", async () => {
const response = await client.array.getDictionaryValid();
Expand Down

0 comments on commit 2633e09

Please sign in to comment.