• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1/*
2 * Copyright (C) 2022 Huawei Device Co., Ltd.
3 * Licensed under the Apache License, Version 2.0 (the "License");
4 * you may not use this file except in compliance with the License.
5 * You may obtain a copy of the License at
6 *
7 *     http://www.apache.org/licenses/LICENSE-2.0
8 *
9 * Unless required by applicable law or agreed to in writing, software
10 * distributed under the License is distributed on an "AS IS" BASIS,
11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 * See the License for the specific language governing permissions and
13 * limitations under the License.
14 */
15
16// @ts-ignore
17import { PayloadProtect } from '../../../dist/hdc/message/PayloadProtect.js';
18
19describe('PayloadProtect Test', () => {
20  let payloadProtect = new PayloadProtect();
21  it('PayloadProtectTest01', function () {
22    expect(payloadProtect).not.toBeUndefined();
23  });
24
25  it('PayloadProtectTest02', function () {
26    expect(payloadProtect.channelId).toBeUndefined();
27  });
28
29  it('PayloadProtectTest03', function () {
30    payloadProtect.channelId = true;
31    expect(payloadProtect.channelId).toBeTruthy();
32  });
33
34  it('PayloadProtectTest04', function () {
35    expect(payloadProtect.commandFlag).toBeUndefined();
36  });
37
38  it('PayloadProtectTest05', function () {
39    payloadProtect.commandFlag = true;
40    expect(payloadProtect.commandFlag).toBeTruthy();
41  });
42
43  it('PayloadProtectTest06', function () {
44    expect(payloadProtect.checkSum).toBeUndefined();
45  });
46
47  it('PayloadProtectTest07', function () {
48    payloadProtect.checkSum = true;
49    expect(payloadProtect.checkSum).toBeTruthy();
50  });
51
52  it('PayloadProtectTest08', function () {
53    expect(payloadProtect.vCode).toBeUndefined();
54  });
55
56  it('PayloadProtectTest9', function () {
57    payloadProtect.vCode = true;
58    expect(payloadProtect.vCode).toBeTruthy();
59  });
60
61  it('PayloadProtectTest10', function () {
62    expect(payloadProtect.toString()).toBeTruthy();
63  });
64});
65