Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix LT-21895: Add test projects to PhonologyServices #312

Merged
merged 3 commits into from
Sep 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions tests/SIL.LCModel.Tests/DomainServices/PhonologyServicesTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,17 @@ private void SetDefaultVernacularWritingSystem(LcmCache cache, CoreWritingSystem
m_cache.ServiceLocator.WritingSystems.DefaultVernacularWritingSystem = vernWritingSystem);
}

private void TestProjects(string directory)
{
foreach (string subdir in Directory.GetDirectories(directory))
foreach (string file in Directory.GetFiles(subdir, "*.fwdata"))
{
CreateTestCache();
TestProject(subdir, file);
DestroyTestCache();
}
}

private void TestProject(string projectsDirectory, string dbFileName)
{
var projectId = new TestProjectId(BackendProviderType.kXML, dbFileName);
Expand Down Expand Up @@ -1223,5 +1234,15 @@ public void TestPhonologicalFeatures()
TestXml(xdoc, xdoc2);
}
}

private string PhonologyProjectsDirectory => Path.Combine(TestDirectoryFinder.RootDirectory, "tests", "SIL.LCModel.Tests", "DomainServices", "TestData", "PhonologyProjects");

[Test]
public void TestPhonologyProjects()
{
// You can test your personal projects with something like
// TestProjects("C:\\Users\\[MyAccount]\\FieldWorks\\DistFiles\\Projects")
TestProjects(PhonologyProjectsDirectory);
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
*/SharedSettings
*/WritingSystemStore
Loading
Loading