• 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 {HdcClient} from "../../../dist/hdc/hdcclient/HdcClient.js"
18import {HdcCommand} from "../../../src/hdc/hdcclient/HdcCommand";
19
20describe('HdcClient Test', ()=>{
21    it('HdcClientTest01', function () {
22        let hdcClient =  new HdcClient()
23        expect(hdcClient.constructor()).toBeUndefined()
24
25    })
26    it('HdcClientTest02', function () {
27        let hdcClient =  new HdcClient()
28        expect(hdcClient.bindStream()).toBeUndefined()
29
30    })
31    it('HdcClientTest03', function () {
32        let hdcClient =  new HdcClient()
33        expect(hdcClient.bindStopStream()).toBeUndefined()
34
35    })
36    it('HdcClientTest04', function () {
37        let hdcClient =  new HdcClient()
38        expect(hdcClient.unbindStream()).toBeTruthy()
39
40    })
41    it('HdcClientTest05', function () {
42        let hdcClient =  new HdcClient()
43        expect(hdcClient.unbindStopStream()).toBeTruthy()
44
45    })
46
47    it('HdcClientTest06', async ()=> {
48        let hdcClient =  new HdcClient();
49        await expect(hdcClient.connectDevice()).rejects.not.toBeUndefined();
50
51    });
52
53    it('HdcClientTest07', async ()=> {
54        let hdcClient =  new HdcClient();
55        await expect(hdcClient.disconnect()).rejects.not.toBeUndefined();
56
57    });
58    it('HdcClientTest08', function () {
59        let hdcClient =  new HdcClient()
60        let data ={
61            getChannelId:jest.fn(()=>-1)
62        }
63        expect(hdcClient.createDataMessage(data)).toBeUndefined()
64
65    })
66})