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 { CounterSummary, SdkSliceSummary } from '../../../src/trace/bean/SdkSummary';
17
18describe('SdkSummary Test', () => {
19  it('SdkSummaryTest01', function () {
20    let counterSummary = new CounterSummary();
21    counterSummary = {
22      value: 0,
23      ts: 0,
24      counter_id: 0,
25    };
26    expect(counterSummary).not.toBeUndefined();
27    expect(counterSummary).toMatchInlineSnapshot(
28{
29  value: expect.any(Number),
30  ts: expect.any(Number),
31  counter_id: expect.any(Number) }, `
32{
33  "counter_id": Any<Number>,
34  "ts": Any<Number>,
35  "value": Any<Number>,
36}
37`);
38  });
39
40  it('SdkSliceSummaryTest02', function () {
41    let sdkSliceSummary = new SdkSliceSummary();
42    sdkSliceSummary = {
43      start_ts: 0,
44      end_ts: 0,
45      value: 0,
46      column_id: 0,
47      slice_message: 'slice_message',
48    };
49    expect(sdkSliceSummary).not.toBeUndefined();
50    expect(sdkSliceSummary).toMatchInlineSnapshot(
51{
52  start_ts: expect.any(Number),
53  end_ts: expect.any(Number),
54  value: expect.any(Number),
55  column_id: expect.any(Number),
56  slice_message: expect.any(String) }, `
57{
58  "column_id": Any<Number>,
59  "end_ts": Any<Number>,
60  "slice_message": Any<String>,
61  "start_ts": Any<Number>,
62  "value": Any<Number>,
63}
64`);
65  });
66});
67