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

StudioResourceRepository_ShowVersionHistory_NoItemsReturned_InfoItemAttachedToParent() private method

        public void StudioResourceRepository_ShowVersionHistory_NoItemsReturned_InfoItemAttachedToParent()
        {
            //------------Setup for test--------------------------
            var mockExplorerResourceRepository = new Mock<IClientExplorerResourceRepository>();
            var mockVersionRepository = new Mock<IVersionRepository>();
            mockVersionRepository.Setup(m => m.GetVersions(It.IsAny<Guid>())).Returns(new List<IExplorerItem>());

            var superWFId = Guid.NewGuid();
            var parent = new ServerExplorerItem
            {
                ResourceType = ResourceType.WorkflowService,
                DisplayName = "SuperWF",
                ResourceId = superWFId,
                Permissions = Permissions.Contribute,
                ResourcePath = "MANFOLDER\\APRIL WORK\\SUB FOLDER"
            };

            SetupEnvironmentRepo(Guid.Empty);

            var repo = new StudioResourceRepository(parent, Guid.Empty, _invoke)
            {
                GetVersionProxy = id => mockVersionRepository.Object,
                GetExplorerProxy = id => mockExplorerResourceRepository.Object,
                GetCurrentEnvironment = () => Guid.Empty
            };
            //------------Execute Test---------------------------
            repo.ShowVersionHistory(Guid.Empty, superWFId);
            //------------Assert Results-------------------------
            var actual = repo.FindItemById(superWFId);
            Assert.AreEqual(1, actual.Children.Count);
            Assert.AreEqual("There is no version history to display", actual.Children[0].DisplayName);
        }
StudioResourceRepositoryTests