Fix failing test to validate TabContent type, not Tab type

This commit is contained in:
John Lewin 2019-01-16 09:06:30 -08:00
parent 875c2b52c4
commit 623105281d
2 changed files with 9 additions and 7 deletions

View file

@ -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}")))
{
}

View file

@ -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<PrinterTabPage>().Count(),
ApplicationController.Instance.MainView.TabControl.AllTabs.Select(t => t.TabContent).OfType<PrinterTabPage>().Count(),
"One printer tab should exist after ReloadAll");
return Task.CompletedTask;