Skip to content

Commit

Permalink
Fix broken tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
Paul Johnson committed Oct 12, 2021
1 parent 84b6022 commit bceab79
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -79,11 +79,10 @@ private static ILocalizedTextService GetLocalizedTextService(IServiceProvider fa
new Lazy<LocalizedTextServiceFileSources>(() =>
{
// get the src folder
var currFolder = new DirectoryInfo(TestContext.CurrentContext.TestDirectory);
while (!currFolder.Name.Equals("src", StringComparison.InvariantCultureIgnoreCase))
{
currFolder = currFolder.Parent;
}
var root = TestContext.CurrentContext.TestDirectory.Split("tests")[0];
var srcFolder = Path.Combine(root, "src");

var currFolder = new DirectoryInfo(srcFolder);

DirectoryInfo uiProject = currFolder.GetDirectories("Umbraco.Web.UI", SearchOption.TopDirectoryOnly).First();
var mainLangFolder = new DirectoryInfo(Path.Combine(uiProject.FullName, globalSettings.Value.UmbracoPath.TrimStart("~/"), "config", "lang"));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ private string GetViewName(ViewResult viewResult, string separator = "/")

private IEnumerable<string> GetUiFiles(IEnumerable<string> pathFromNetCore)
{
var sourceRoot = TestContext.CurrentContext.TestDirectory.Split("Umbraco.Tests.UnitTests")[0];
var pathToFiles = Path.Combine(sourceRoot, "Umbraco.Web.UI");
var root = TestContext.CurrentContext.TestDirectory.Split("tests")[0];
var pathToFiles = Path.Combine(root, "src", "Umbraco.Web.UI");
foreach (var pathSection in pathFromNetCore)
{
pathToFiles = Path.Combine(pathToFiles, pathSection);
Expand Down

0 comments on commit bceab79

Please sign in to comment.