// ReSharper disable once InconsistentNaming public void ExplorerView_Move_FolderExpectPopup() { //------------Setup for test-------------------------- var stud = new Mock <IStudioResourceRepository>(); var popup = new Mock <IPopupController>(); CustomContainer.Register(popup.Object); var model1 = new ExplorerItemModel(new Mock <IConnectControlSingleton>().Object, new Mock <IStudioResourceRepository>().Object) { ResourceType = ResourceType.Folder, ResourcePath = "bob", EnvironmentId = Guid.NewGuid() }; var model2 = new ExplorerItemModel(new Mock <IConnectControlSingleton>().Object, new Mock <IStudioResourceRepository>().Object) { ResourceType = ResourceType.Folder, ResourcePath = "dave", Parent = new ExplorerItemModel(new Mock <IConnectControlSingleton>().Object, new Mock <IStudioResourceRepository>().Object) { ResourcePath = "moo" } }; stud.Setup(a => a.MoveItem(model1, "bob")); ExplorerView.MoveItem(model1, model2, stud.Object); //------------Execute Test--------------------------- popup.Verify(a => a.Show()); popup.VerifySet(a => a.Description = "You are not allowed to move items between Servers using the explorer. Please use the deploy instead"); //------------Assert Results------------------------- }
// ReSharper disable once InconsistentNaming public void ExplorerView_Move_FolderExpectRename() { //------------Setup for test-------------------------- var stud = new Mock <IStudioResourceRepository>(); var model1 = new ExplorerItemModel(new Mock <IConnectControlSingleton>().Object, new Mock <IStudioResourceRepository>().Object) { ResourceType = ResourceType.Folder, ResourcePath = "bob" }; var model2 = new ExplorerItemModel(new Mock <IConnectControlSingleton>().Object, new Mock <IStudioResourceRepository>().Object) { ResourceType = ResourceType.Folder, ResourcePath = "dave", Parent = new ExplorerItemModel(new Mock <IConnectControlSingleton>().Object, new Mock <IStudioResourceRepository>().Object) { ResourcePath = "moo" } }; stud.Setup(a => a.MoveItem(model1, "bob")); ExplorerView.MoveItem(model1, model2, stud.Object); //------------Execute Test--------------------------- stud.Verify(a => a.MoveItem(model1, "dave")); //------------Assert Results------------------------- }