From 623105281dbfeabaf13e2219c9f61df248cb35fd Mon Sep 17 00:00:00 2001 From: John Lewin Date: Wed, 16 Jan 2019 09:06:30 -0800 Subject: [PATCH] Fix failing test to validate TabContent type, not Tab type --- Program.cs | 10 +++++----- .../MatterControlTests.cs | 6 ++++-- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/Program.cs b/Program.cs index 84b020a05..7042fb473 100644 --- a/Program.cs +++ b/Program.cs @@ -102,16 +102,16 @@ namespace MatterHackers.MatterControl //#endif var serviceHost = new ServiceHost( - typeof(LocalService), + typeof(LocalService), new Uri[] { new Uri("net.pipe://localhost/") }); serviceHost.AddServiceEndpoint(typeof(IMainService), new NetNamedPipeBinding(), mainServiceName); serviceHost.Open(); Console.Write( - "Service started: {0};", + "Service started: {0};", string.Join(", ", serviceHost.Description.Endpoints.Select(s => s.ListenUri.AbsoluteUri).ToArray())); - + // Load optional user configuration IConfiguration config = new ConfigurationBuilder() .AddJsonFile("appsettings.json", optional: true) @@ -177,7 +177,7 @@ namespace MatterHackers.MatterControl public void ShellOpenFile(string[] files) { // If at least one argument is an acceptable shell file extension - var itemsToAdd = files.Where(f => File.Exists(f) + var itemsToAdd = files.Where(f => File.Exists(f) && shellFileExtensions.Contains(Path.GetExtension(f).ToLower())); if (itemsToAdd.Any()) @@ -200,7 +200,7 @@ namespace MatterHackers.MatterControl : base( new ServiceEndpoint( ContractDescription.GetContract(typeof(IMainService)), - new NetNamedPipeBinding(), + new NetNamedPipeBinding(), new EndpointAddress($"net.pipe://localhost/{mainServiceName}"))) { } diff --git a/Tests/MatterControl.AutomationTests/MatterControlTests.cs b/Tests/MatterControl.AutomationTests/MatterControlTests.cs index c2fb7a1ea..49792a37c 100644 --- a/Tests/MatterControl.AutomationTests/MatterControlTests.cs +++ b/Tests/MatterControl.AutomationTests/MatterControlTests.cs @@ -91,7 +91,7 @@ namespace MatterHackers.MatterControl.Tests.Automation testRunner.SwitchToSliceSettings(); // Move to Adhesion tab - testRunner.SelectSliceSettingsField("Advanced", "skirts"); + testRunner.SelectSliceSettingsField(PrinterSettings.Layout.SliceSettings, "skirts"); // Click Brim toggle field forcing ReloadAll testRunner.WaitForReloadAll(() => testRunner.ClickByName("Create Brim Field")); @@ -102,9 +102,11 @@ namespace MatterHackers.MatterControl.Tests.Automation ApplicationController.Instance.ActivePrinters.Count(), "One printer should exist after Airwolf add"); + testRunner.Delay(2); + Assert.AreEqual( 1, - ApplicationController.Instance.MainView.TabControl.AllTabs.OfType().Count(), + ApplicationController.Instance.MainView.TabControl.AllTabs.Select(t => t.TabContent).OfType().Count(), "One printer tab should exist after ReloadAll"); return Task.CompletedTask;