diff --git a/Dev/Warewolf.AcceptanceTesting.Core/UnityBootstrapperForTesting.cs b/Dev/Warewolf.AcceptanceTesting.Core/UnityBootstrapperForTesting.cs index 9c6eacf25e1..50a44ff16eb 100644 --- a/Dev/Warewolf.AcceptanceTesting.Core/UnityBootstrapperForTesting.cs +++ b/Dev/Warewolf.AcceptanceTesting.Core/UnityBootstrapperForTesting.cs @@ -15,7 +15,7 @@ public abstract class UnityBootstrapperForTesting : UnityBootstrapper { protected override DependencyObject CreateShell() { - return Container.Resolve(); + return new DependencyObject(); } protected override void ConfigureContainer() diff --git a/Dev/Warewolf.Studio.Views/ExplorerViewTestClass.cs b/Dev/Warewolf.Studio.Views/ExplorerViewTestClass.cs index dfafe5285ad..e6d31bb39c1 100644 --- a/Dev/Warewolf.Studio.Views/ExplorerViewTestClass.cs +++ b/Dev/Warewolf.Studio.Views/ExplorerViewTestClass.cs @@ -1,3 +1,4 @@ +using System; using System.Collections.Generic; using System.Linq; using Dev2.Common.Interfaces.Data; @@ -131,5 +132,32 @@ private IEnumerable Descendants(XamDataTreeNode root) foreach (var n in node.Nodes) nodes.Push(n); } } + + public void PerformFolderAdd(string folder, string server) + { + var node = _explorerView.ExplorerTree.Nodes.FirstOrDefault(a => ((IEnvironmentViewModel)a.Data).DisplayName.Contains(server)); + + if (node != null) + { + var env = (node.Data as IEnvironmentViewModel); + if (env != null) + { + env.CreateFolderCommand.Execute(null); + var explorerItemViewModel = env.Children.FirstOrDefault(a => a.IsRenaming); + if (explorerItemViewModel != null) + { + explorerItemViewModel.ResourceName = folder; + explorerItemViewModel.IsRenaming = false; + + } + else + throw new Exception("Folder was not found after adding"); + + } + + } + else + throw new Exception("Server Not found in explorer"); + } } } \ No newline at end of file diff --git a/Dev/Warewolf.Studio.Views/RequestServiceNameView.xaml.cs b/Dev/Warewolf.Studio.Views/RequestServiceNameView.xaml.cs index 9b413925eb5..011a6160919 100644 --- a/Dev/Warewolf.Studio.Views/RequestServiceNameView.xaml.cs +++ b/Dev/Warewolf.Studio.Views/RequestServiceNameView.xaml.cs @@ -71,7 +71,7 @@ public bool HasServer(string serverName) public void CreateNewFolder(string newFolderName, string rootPath) { ExplorerViewTestClass viewTestClass = new ExplorerViewTestClass(ExplorerView); - + viewTestClass.PerformFolderAdd(newFolderName,rootPath); } } }