1/*
2 * Copyright (c) 2023 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 {describe, it} from 'mocha';
17import {assert} from 'chai';
18import {getNameGenerator, NameGeneratorType} from '../../src/generator/NameFactory';
19import {NameGeneratorOptions} from '../../src/generator/INameGenerator';
20
21const orderedName = [
22  'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j',
23  'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't',
24  'u', 'v', 'w', 'x', 'y', 'z', 'a1', 'b1', 'c1', 'd1',
25  'e1', 'f1', 'g1', 'h1', 'i1', 'j1', 'k1', 'l1', 'm1', 'n1',
26  'o1', 'p1', 'q1', 'r1', 's1', 't1', 'u1', 'v1', 'w1', 'x1',
27  'y1', 'z1', 'a2', 'b2', 'c2', 'd2', 'e2', 'f2', 'g2', 'h2',
28  'i2', 'j2', 'k2', 'l2', 'm2', 'n2', 'o2', 'p2', 'q2', 'r2',
29  's2', 't2', 'u2', 'v2', 'w2', 'x2', 'y2', 'z2', 'a3', 'b3',
30  'c3', 'd3', 'e3', 'f3', 'g3', 'h3', 'i3', 'j3', 'k3', 'l3',
31  'm3', 'n3', 'o3', 'p3', 'q3', 'r3', 's3', 't3', 'u3', 'v3',
32  'w3', 'x3', 'y3', 'z3'
33];
34
35describe("test for name generator", function () {
36  describe('ordered name generator test', function () {
37    it('ordered name generator check', function () {
38      const orderedGenerator = getNameGenerator(NameGeneratorType.ORDERED);
39
40      for (let i = 0; i < 104; i++) {
41        assert.strictEqual(orderedGenerator.getName(), orderedName[i]);
42      }
43    });
44  });
45});
46