Example #1
0
        public void RenameAllLangs()
        {
            var fullPathMemberDocs = Path.GetFullPath("TestMemberDocsAllLangs");
            var fullPathOrig       = Path.GetFullPath("TestMemberDocsAllLangsOrig");

            DirectoryUtil.CopyDirectoryFromScratch(fullPathOrig, fullPathMemberDocs);

            var project = new DocumentDataItemProject {
                asmLocation = _assemblyLocation, docPath = fullPathMemberDocs
            };

            project.ReloadAllProjectData();

            var oldFilesCount = Directory.GetFiles(fullPathMemberDocs).Length;
            var success       = project.AssignDocToAsm("PlayerSettings.Android", "Android", fullPathMemberDocs);

            AssertSuccessCode(success);
            success = project.AssignDocToAsm("PlayerSettings.iOS", "iOS", fullPathMemberDocs);
            AssertSuccessCode(success);
            var newFiles      = Directory.GetFiles(fullPathMemberDocs);
            var newFilesCount = newFiles.Length;

            Assert.AreEqual(oldFilesCount, newFilesCount);

            var korMemberDocs = Path.Combine(fullPathMemberDocs, "Korean");

            var expectedAndroidNameKorean = Path.Combine(korMemberDocs, "PlayerSettings.Android.mem");

            Assert.IsTrue(File.Exists(expectedAndroidNameKorean));

            var expectedIOSNameKorean = Path.Combine(korMemberDocs, "PlayerSettings.iOS.mem");

            Assert.IsTrue(File.Exists(expectedIOSNameKorean));
        }
Example #2
0
        public void RenameEnglishOnly()
        {
            var fullPathMemberDocs = Path.GetFullPath("TestMemberDocs");
            var fullPathOrig       = Path.GetFullPath("TestMemberDocsOrig");

            DirectoryUtil.CopyDirectoryFromScratch(fullPathOrig, fullPathMemberDocs);

            var project = new DocumentDataItemProject();

            project.ReloadAllProjectData();

            var oldFilesCount = Directory.GetFiles(fullPathMemberDocs).Length;
            var successCode   = project.AssignDocToAsm("PlayerSettings.Android", "Android", fullPathMemberDocs);

            AssertSuccessCode(successCode);
            successCode = project.AssignDocToAsm("PlayerSettings.iOS", "iOS", fullPathMemberDocs);
            AssertSuccessCode(successCode);

            var newFiles      = Directory.GetFiles(fullPathMemberDocs);
            var newFilesCount = newFiles.Length;

            Assert.AreEqual(oldFilesCount, newFilesCount);

            var expectedAndroidName = Path.Combine(fullPathMemberDocs, "PlayerSettings.Android.mem");

            Assert.IsTrue(File.Exists(expectedAndroidName));

            var expectedIOSName = Path.Combine(fullPathMemberDocs, "PlayerSettings.iOS.mem");

            Assert.IsTrue(File.Exists(expectedIOSName));
        }