Dev2.Core.Tests.Repositories.StudioResourceRepositoryTests.StudioResourceRepository_MoveItem_Version_ExpectNothing C# (CSharp) Method

StudioResourceRepository_MoveItem_Version_ExpectNothing() private method

        public void StudioResourceRepository_MoveItem_Version_ExpectNothing()
        {
            //------------Setup for test--------------------------
            var mockExplorerResourceRepository = new Mock<IClientExplorerResourceRepository>();
            mockExplorerResourceRepository.Setup(m => m.RenameFolder(It.IsAny<string>(), It.IsAny<string>(), It.IsAny<Guid>()))
                                          .Returns(new ExplorerRepositoryResult(ExecStatus.Success, "Success"))
                                          .Verifiable();

            var environmentId = Guid.NewGuid();
            var workflowId = Guid.NewGuid();
            var mockResourceRepository = new Mock<IResourceRepository>();
            Mock<IResourceModel> mockResourceModel = new Mock<IResourceModel>();
            mockResourceModel.SetupProperty(model => model.Category);
            mockResourceModel.SetupProperty(model => model.ResourceName);
            mockResourceModel.Object.Category = "MyCat";
            mockResourceModel.Object.ResourceName = "MyResName";
            mockResourceRepository.Setup(resourceRepository => resourceRepository.Find(It.IsAny<Expression<Func<IResourceModel, bool>>>())).Returns(new List<IResourceModel> { mockResourceModel.Object });
            Mock<IEnvironmentModel> mockEnvironment = EnviromentRepositoryTest.CreateMockEnvironment(mockResourceRepository.Object, "localhost");
            mockEnvironment.Setup(model => model.ID).Returns(environmentId);
            GetEnvironmentRepository(mockEnvironment);
            var mockVersionRepository = new Mock<IVersionRepository>();
            var repository = new StudioResourceRepository(GetTestData(workflowId.ToString()), environmentId, _invoke)
            {
                GetVersionProxy = id => mockVersionRepository.Object,
                GetExplorerProxy = id => mockExplorerResourceRepository.Object
            };
            //------------Execute Test---------------------------

            var explorerItemModel = repository.ExplorerItemModels[0].Children[0];
            explorerItemModel.ResourceType = ResourceType.Version;
            explorerItemModel.Children[0].ResourcePath = "\\folder1\\bob\\dave";
            explorerItemModel.ResourcePath = "\\folder1\\bob";
            repository.MoveItem(explorerItemModel, "New Name");
            //------------Assert Results-------------------------
            mockExplorerResourceRepository.Verify(m => m.RenameFolder("\\folder1\\bob", "New Name\\folder1", It.IsAny<Guid>()), Times.Never());

            //------------Execute Test---------------------------
        }
StudioResourceRepositoryTests