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 16import { USBHead } from '../../../src/hdc/message/USBHead'; 17 18describe('USBHead Test', () => { 19 let usbHead = new USBHead(); 20 it('USBHeadTest01', function () { 21 expect(usbHead).not.toBeUndefined(); 22 }); 23 24 it('USBHeadTest02', function () { 25 expect(usbHead.flag).toBeUndefined(); 26 }); 27 28 it('USBHeadTest03', function () { 29 usbHead.flag = true; 30 expect(usbHead.flag).toBeTruthy(); 31 }); 32 33 it('USBHeadTest04', function () { 34 expect(usbHead.option).toBeUndefined(); 35 }); 36 37 it('USBHeadTest05', function () { 38 usbHead.option = true; 39 expect(usbHead.option).toBeTruthy(); 40 }); 41 42 it('USBHeadTest06', function () { 43 expect(usbHead.sessionId).toBeUndefined(); 44 }); 45 46 it('USBHeadTest07', function () { 47 usbHead.sessionId = true; 48 expect(usbHead.sessionId).toBeTruthy(); 49 }); 50 51 it('USBHeadTest08', function () { 52 expect(usbHead.dataSize).toBeFalsy(); 53 }); 54 55 it('USBHeadTest09', function () { 56 usbHead.dataSize = true; 57 expect(usbHead.dataSize).toBeTruthy(); 58 }); 59 60 it('USBHeadTest10', function () { 61 expect(usbHead.toString()).not.toBeUndefined(); 62 }); 63 64 it('USBHeadTest11', function () { 65 usbHead.parseHeadData = jest.fn(() => undefined); 66 expect(usbHead.parseHeadData()).toBeUndefined(); 67 }); 68}); 69