• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1/*
2 * Copyright (c) 2021 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 { paramMock } from '../utils';
17import { RdbPredicatesClass } from './ohos_data_rdb'
18
19export function mockDataAbility() {
20  const DataAbilityPredicatesClass = class DataAbilityPredicates {
21    constructor() {
22      console.warn('DataAbility.DataAbilityPredicates.constructor interface mocked in the Previewer. How this interface works on' +
23        ' the Previewer may be different from that on a real device.');
24      this.equalTo = function (...args) {
25        console.warn('DataAbilityPredicates.equalTo interface mocked in the Previewer. How this interface works on the' +
26          ' Previewer may be different from that on a real device.');
27        return new DataAbilityPredicatesClass();
28      };
29      this.notEqualTo = function (...args) {
30        console.warn('DataAbilityPredicates.notEqualTo interface mocked in the Previewer. How this interface works on the' +
31          ' Previewer may be different from that on a real device.');
32        return new DataAbilityPredicatesClass();
33      };
34      this.beginWrap = function (...args) {
35        console.warn('DataAbilityPredicates.beginWrap interface mocked in the Previewer. How this interface works on the' +
36          ' Previewer may be different from that on a real device.');
37        return new DataAbilityPredicatesClass();
38      };
39      this.endWrap = function (...args) {
40        console.warn('DataAbilityPredicates.endWrap interface mocked in the Previewer. How this interface works on the' +
41          ' Previewer may be different from that on a real device.');
42        return new DataAbilityPredicatesClass();
43      };
44      this.or = function (...args) {
45        console.warn('DataAbilityPredicates.or interface mocked in the Previewer. How this interface works on the' +
46          ' Previewer may be different from that on a real device.');
47        return new DataAbilityPredicatesClass();
48      };
49      this.and = function (...args) {
50        console.warn('DataAbilityPredicates.and interface mocked in the Previewer. How this interface works on the' +
51          ' Previewer may be different from that on a real device.');
52        return new DataAbilityPredicatesClass();
53      };
54      this.contains = function (...args) {
55        console.warn('DataAbilityPredicates.contains interface mocked in the Previewer. How this interface works on the' +
56          ' Previewer may be different from that on a real device.');
57        return new DataAbilityPredicatesClass();
58      };
59      this.beginsWith = function (...args) {
60        console.warn('DataAbilityPredicates.beginsWith interface mocked in the Previewer. How this interface works on the' +
61          ' Previewer may be different from that on a real device.');
62        return new DataAbilityPredicatesClass();
63      };
64      this.endsWith = function (...args) {
65        console.warn('DataAbilityPredicates.endsWith interface mocked in the Previewer. How this interface works on the' +
66          ' Previewer may be different from that on a real device.');
67        return new DataAbilityPredicatesClass();
68      };
69      this.isNull = function (...args) {
70        console.warn('DataAbilityPredicates.isNull interface mocked in the Previewer. How this interface works on the' +
71          ' Previewer may be different from that on a real device.');
72        return new DataAbilityPredicatesClass();
73      };
74      this.isNotNull = function (...args) {
75        console.warn('DataAbilityPredicates.isNotNull interface mocked in the Previewer. How this interface works on the' +
76          ' Previewer may be different from that on a real device.');
77        return new DataAbilityPredicatesClass();
78      };
79      this.like = function (...args) {
80        console.warn('DataAbilityPredicates.like interface mocked in the Previewer. How this interface works on the' +
81          ' Previewer may be different from that on a real device.');
82        return new DataAbilityPredicatesClass();
83      };
84      this.glob = function (...args) {
85        console.warn('DataAbilityPredicates.glob interface mocked in the Previewer. How this interface works on the' +
86          ' Previewer may be different from that on a real device.');
87        return new DataAbilityPredicatesClass();
88      };
89      this.between = function (...args) {
90        console.warn('DataAbilityPredicates.between interface mocked in the Previewer. How this interface works on the' +
91          ' Previewer may be different from that on a real device.');
92        return new DataAbilityPredicatesClass();
93      };
94      this.notBetween = function (...args) {
95        console.warn('DataAbilityPredicates.notBetween interface mocked in the Previewer. How this interface works on the' +
96          ' Previewer may be different from that on a real device.');
97        return new DataAbilityPredicatesClass();
98      };
99      this.greaterThan = function (...args) {
100        console.warn('DataAbilityPredicates.greaterThan interface mocked in the Previewer. How this interface works on the' +
101          ' Previewer may be different from that on a real device.');
102        return new DataAbilityPredicatesClass();
103      };
104      this.lessThan = function (...args) {
105        console.warn('DataAbilityPredicates.lessThan interface mocked in the Previewer. How this interface works on the' +
106          ' Previewer may be different from that on a real device.');
107        return new DataAbilityPredicatesClass();
108      };
109      this.greaterThanOrEqualTo = function (...args) {
110        console.warn('DataAbilityPredicates.greaterThanOrEqualTo interface mocked in the Previewer. How this interface works on the' +
111          ' Previewer may be different from that on a real device.');
112        return new DataAbilityPredicatesClass();
113      };
114      this.lessThanOrEqualTo = function (...args) {
115        console.warn('DataAbilityPredicates.lessThanOrEqualTo interface mocked in the Previewer. How this interface works on the' +
116          ' Previewer may be different from that on a real device.');
117        return new DataAbilityPredicatesClass();
118      };
119      this.orderByAsc = function (...args) {
120        console.warn('DataAbilityPredicates.orderByAsc interface mocked in the Previewer. How this interface works on the' +
121          ' Previewer may be different from that on a real device.');
122        return new DataAbilityPredicatesClass();
123      };
124      this.orderByDesc = function (...args) {
125        console.warn('DataAbilityPredicates.orderByDesc interface mocked in the Previewer. How this interface works on the' +
126          ' Previewer may be different from that on a real device.');
127        return new DataAbilityPredicatesClass();
128      };
129      this.distinct = function (...args) {
130        console.warn('DataAbilityPredicates.distinct interface mocked in the Previewer. How this interface works on the' +
131          ' Previewer may be different from that on a real device.');
132        return new DataAbilityPredicatesClass();
133      };
134      this.limitAs = function (...args) {
135        console.warn('DataAbilityPredicates.limitAs interface mocked in the Previewer. How this interface works on the' +
136          ' Previewer may be different from that on a real device.');
137        return new DataAbilityPredicatesClass();
138      };
139      this.offsetAs = function (...args) {
140        console.warn('DataAbilityPredicates.offsetAs interface mocked in the Previewer. How this interface works on the' +
141          ' Previewer may be different from that on a real device.');
142        return new DataAbilityPredicatesClass();
143      };
144      this.groupBy = function (...args) {
145        console.warn('DataAbilityPredicates.groupBy interface mocked in the Previewer. How this interface works on the' +
146          ' Previewer may be different from that on a real device.');
147        return new DataAbilityPredicatesClass();
148      };
149      this.indexedBy = function (...args) {
150        console.warn('DataAbilityPredicates.indexedBy interface mocked in the Previewer. How this interface works on the' +
151          ' Previewer may be different from that on a real device.');
152        return new DataAbilityPredicatesClass();
153      };
154      this.in = function (...args) {
155        console.warn('DataAbilityPredicates.in interface mocked in the Previewer. How this interface works on the' +
156          ' Previewer may be different from that on a real device.');
157        return new DataAbilityPredicatesClass();
158      };
159      this.notIn = function (...args) {
160        console.warn('DataAbilityPredicates.notIn interface mocked in the Previewer. How this interface works on the' +
161          ' Previewer may be different from that on a real device.');
162        return new DataAbilityPredicatesClass();
163      };
164    }
165  };
166  const dataAbilityMock = {
167    createRdbPredicates: function (...args) {
168      console.warn('DataAbility.createRdbPredicates.constructor interface mocked in the Previewer. How this interface works on' +
169        ' the Previewer may be different from that on a real device.');
170      return new RdbPredicatesClass();
171    },
172    DataAbilityPredicates: DataAbilityPredicatesClass
173  };
174  return dataAbilityMock;
175}
176