Skip to content

Commit

Permalink
continued with specs
Browse files Browse the repository at this point in the history
  • Loading branch information
Hagashen Naidu authored and Hagashen Naidu committed Feb 12, 2015
1 parent 8bc7c11 commit e30cc6a
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public abstract class UnityBootstrapperForTesting : UnityBootstrapper
{
protected override DependencyObject CreateShell()
{
return Container.Resolve<ShellForTesting>();
return new DependencyObject();
}

protected override void ConfigureContainer()
Expand Down
28 changes: 28 additions & 0 deletions Dev/Warewolf.Studio.Views/ExplorerViewTestClass.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
using System;
using System.Collections.Generic;
using System.Linq;
using Dev2.Common.Interfaces.Data;
Expand Down Expand Up @@ -131,5 +132,32 @@ private IEnumerable<XamDataTreeNode> 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");
}
}
}
2 changes: 1 addition & 1 deletion Dev/Warewolf.Studio.Views/RequestServiceNameView.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
}

0 comments on commit e30cc6a

Please sign in to comment.