13af6ab5fSopenharmony_ci/*
23af6ab5fSopenharmony_ci * Copyright (c) 2023 Huawei Device Co., Ltd.
33af6ab5fSopenharmony_ci * Licensed under the Apache License, Version 2.0 (the "License");
43af6ab5fSopenharmony_ci * you may not use this file except in compliance with the License.
53af6ab5fSopenharmony_ci * You may obtain a copy of the License at
63af6ab5fSopenharmony_ci *
73af6ab5fSopenharmony_ci *     http://www.apache.org/licenses/LICENSE-2.0
83af6ab5fSopenharmony_ci *
93af6ab5fSopenharmony_ci * Unless required by applicable law or agreed to in writing, software
103af6ab5fSopenharmony_ci * distributed under the License is distributed on an "AS IS" BASIS,
113af6ab5fSopenharmony_ci * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
123af6ab5fSopenharmony_ci * See the License for the specific language governing permissions and
133af6ab5fSopenharmony_ci * limitations under the License.
143af6ab5fSopenharmony_ci */
153af6ab5fSopenharmony_ci
163af6ab5fSopenharmony_ciimport {describe, it} from 'mocha';
173af6ab5fSopenharmony_ciimport {assert} from 'chai';
183af6ab5fSopenharmony_ciimport {getNameGenerator, NameGeneratorType} from '../../src/generator/NameFactory';
193af6ab5fSopenharmony_ciimport {NameGeneratorOptions} from '../../src/generator/INameGenerator';
203af6ab5fSopenharmony_ci
213af6ab5fSopenharmony_ciconst orderedName = [
223af6ab5fSopenharmony_ci  'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j',
233af6ab5fSopenharmony_ci  'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't',
243af6ab5fSopenharmony_ci  'u', 'v', 'w', 'x', 'y', 'z', 'a1', 'b1', 'c1', 'd1',
253af6ab5fSopenharmony_ci  'e1', 'f1', 'g1', 'h1', 'i1', 'j1', 'k1', 'l1', 'm1', 'n1',
263af6ab5fSopenharmony_ci  'o1', 'p1', 'q1', 'r1', 's1', 't1', 'u1', 'v1', 'w1', 'x1',
273af6ab5fSopenharmony_ci  'y1', 'z1', 'a2', 'b2', 'c2', 'd2', 'e2', 'f2', 'g2', 'h2',
283af6ab5fSopenharmony_ci  'i2', 'j2', 'k2', 'l2', 'm2', 'n2', 'o2', 'p2', 'q2', 'r2',
293af6ab5fSopenharmony_ci  's2', 't2', 'u2', 'v2', 'w2', 'x2', 'y2', 'z2', 'a3', 'b3',
303af6ab5fSopenharmony_ci  'c3', 'd3', 'e3', 'f3', 'g3', 'h3', 'i3', 'j3', 'k3', 'l3',
313af6ab5fSopenharmony_ci  'm3', 'n3', 'o3', 'p3', 'q3', 'r3', 's3', 't3', 'u3', 'v3',
323af6ab5fSopenharmony_ci  'w3', 'x3', 'y3', 'z3'
333af6ab5fSopenharmony_ci];
343af6ab5fSopenharmony_ci
353af6ab5fSopenharmony_cidescribe("test for name generator", function () {
363af6ab5fSopenharmony_ci  describe('ordered name generator test', function () {
373af6ab5fSopenharmony_ci    it('ordered name generator check', function () {
383af6ab5fSopenharmony_ci      const orderedGenerator = getNameGenerator(NameGeneratorType.ORDERED);
393af6ab5fSopenharmony_ci
403af6ab5fSopenharmony_ci      for (let i = 0; i < 104; i++) {
413af6ab5fSopenharmony_ci        assert.strictEqual(orderedGenerator.getName(), orderedName[i]);
423af6ab5fSopenharmony_ci      }
433af6ab5fSopenharmony_ci    });
443af6ab5fSopenharmony_ci  });
453af6ab5fSopenharmony_ci});
46