From 00f1e4a247c2943e453f031c734f87568062302a Mon Sep 17 00:00:00 2001 From: Mole Date: Fri, 21 Aug 2020 14:20:30 +0200 Subject: [PATCH] Assert that the view exists in InstallControllerTest --- .../Umbraco.Web.Common/InstallControllerTest.cs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/Umbraco.Tests.UnitTests/Umbraco.Web.Common/InstallControllerTest.cs b/src/Umbraco.Tests.UnitTests/Umbraco.Web.Common/InstallControllerTest.cs index fc59231bee..847d0a900b 100644 --- a/src/Umbraco.Tests.UnitTests/Umbraco.Web.Common/InstallControllerTest.cs +++ b/src/Umbraco.Tests.UnitTests/Umbraco.Web.Common/InstallControllerTest.cs @@ -13,6 +13,7 @@ using AutoFixture.NUnit3; using Umbraco.Core.Hosting; using System.IO; using System.Reflection; +using System.Linq; namespace Umbraco.Tests.UnitTests.Umbraco.Web.Common { @@ -29,7 +30,11 @@ namespace Umbraco.Tests.UnitTests.Umbraco.Web.Common var viewResult = await sut.Index() as ViewResult; var sections = viewResult.ViewName.Split("\\"); var fileName = sections[sections.Length - 1]; - var location = new FileInfo(typeof(InstallController).Assembly.Location).Directory; + + // TODO: Don't use DirectoryInfo to get contents of UmbracoInstall, use something that works everywhere. + var views = new DirectoryInfo(@"..\\..\\..\\..\\Umbraco.Web.UI.NetCore\\umbraco\\UmbracoInstall").GetFiles() + .Select(f => f.Name).ToArray(); + Assert.True(views.Contains(fileName), $"Expected {fileName} to exist, but it didn't"); } } }