Skip to content

Commit 6670cd8

Browse files
author
BMh
committed
add encapsulation tests
1 parent b6e28da commit 6670cd8

File tree

2 files changed

+77
-1
lines changed

2 files changed

+77
-1
lines changed

src/enip/encapsulation/__snapshots__/encapsulation.spec.js.snap

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -217,6 +217,70 @@ Array [
217217
]
218218
`;
219219

220+
exports[`Encapsulation Test Encapsulation Generator Functions ListIdentity Returns Correct Encapsulation String 1`] = `
221+
Object {
222+
"data": Array [
223+
99,
224+
0,
225+
0,
226+
0,
227+
0,
228+
0,
229+
0,
230+
0,
231+
0,
232+
0,
233+
0,
234+
0,
235+
0,
236+
0,
237+
0,
238+
0,
239+
0,
240+
0,
241+
0,
242+
0,
243+
0,
244+
0,
245+
0,
246+
0,
247+
],
248+
"type": "Buffer",
249+
}
250+
`;
251+
252+
exports[`Encapsulation Test Encapsulation Generator Functions ListServices Returns Correct Encapsulation String 1`] = `
253+
Object {
254+
"data": Array [
255+
4,
256+
0,
257+
0,
258+
0,
259+
0,
260+
0,
261+
0,
262+
0,
263+
0,
264+
0,
265+
0,
266+
0,
267+
0,
268+
0,
269+
0,
270+
0,
271+
0,
272+
0,
273+
0,
274+
0,
275+
0,
276+
0,
277+
0,
278+
0,
279+
],
280+
"type": "Buffer",
281+
}
282+
`;
283+
220284
exports[`Encapsulation Test Encapsulation Generator Functions Register Session Returns Correct Encapsulation String 1`] = `
221285
Object {
222286
"data": Array [

src/enip/encapsulation/encapsulation.spec.js

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ describe("Encapsulation", () => {
7070
});
7171

7272
describe("Test Encapsulation Generator Functions", () => {
73-
const { registerSession, unregisterSession, sendRRData, sendUnitData } = encapsulation;
73+
const { registerSession, unregisterSession, sendRRData, sendUnitData, listIdentity, listServices } = encapsulation;
7474

7575
it("Register Session Returns Correct Encapsulation String", () => {
7676
const data = registerSession();
@@ -95,6 +95,18 @@ describe("Encapsulation", () => {
9595

9696
expect(data).toMatchSnapshot();
9797
});
98+
99+
it("ListIdentity Returns Correct Encapsulation String", () => {
100+
const data = listIdentity();
101+
102+
expect(data).toMatchSnapshot();
103+
});
104+
105+
it("ListServices Returns Correct Encapsulation String", () => {
106+
const data = listServices();
107+
108+
expect(data).toMatchSnapshot();
109+
});
98110
});
99111

100112
describe("Test Common Packet Format Helper Functions", () => {

0 commit comments

Comments
 (0)