コード例 #1
0
        public void GenerateNewNameTest()
        {
            UniqueNameGenerator _newInstance = new UniqueNameGenerator("RandomPrefix");
            string _newName1 = _newInstance.GenerateNewName();

            Assert.IsTrue(_newName1.StartsWith("RandomPrefix"));
            for (int i = 0; i < 1000; i++)
            {
                string _newName = _newInstance.GenerateNewName();
                Assert.AreNotEqual <string>(_newName1, _newName);
                Assert.IsTrue(_newName.StartsWith("RandomPrefix"));
                Assert.IsTrue(_newName.Contains($"{i+1}"), $"{_newName} - for {i}");
            }
        }