public void FetchResourceDuplicates_HandlesType_ExpectName()
        {
            //------------Setup for test--------------------------
            var FetchResourceDuplicates = new FetchResourceDuplicates();

            //------------Execute Test---------------------------
            //------------Assert Results-------------------------
            Assert.AreEqual("FetchResourceDuplicates", FetchResourceDuplicates.HandlesType());
        }
        public void FetchResourceDuplicates_CreateServiceEntry_ExpectProperlyFormedDynamicService()
        {
            //------------Setup for test--------------------------
            var FetchResourceDuplicates = new FetchResourceDuplicates();
            //------------Execute Test---------------------------
            var a = FetchResourceDuplicates.CreateServiceEntry();
            //------------Assert Results-------------------------
            var b = a.DataListSpecification.ToString();

            Assert.AreEqual("<DataList><ResourceType ColumnIODirection=\"Input\"/><Roles ColumnIODirection=\"Input\"/><ResourceName ColumnIODirection=\"Input\"/><Dev2System.ManagmentServicePayload ColumnIODirection=\"Both\"></Dev2System.ManagmentServicePayload></DataList>", b);
        }
        public void GetAuthorizationContextForService_ShouldReturnContext()
        {
            //------------Setup for test--------------------------
            var fetchResourceDuplicates = new FetchResourceDuplicates();

            //------------Execute Test---------------------------
            var resId = fetchResourceDuplicates.GetAuthorizationContextForService();

            //------------Assert Results-------------------------
            Assert.AreEqual(AuthorizationContext.Any, resId);
        }
        public void GetResourceID_ShouldReturnEmptyGuid()
        {
            //------------Setup for test--------------------------
            var fetchResourceDuplicates = new FetchResourceDuplicates();

            //------------Execute Test---------------------------
            var resId = fetchResourceDuplicates.GetResourceID(new Dictionary <string, StringBuilder>());

            //------------Assert Results-------------------------
            Assert.AreEqual(Guid.Empty, resId);
        }
        public void FetchResourceDuplicates_Execute_ExpectName()
        {
            //------------Setup for test--------------------------
            var FetchResourceDuplicates = new FetchResourceDuplicates();

            var serverExplorerItem = new ServerExplorerItem("a", Guid.NewGuid(), "Folder", null, Permissions.DeployFrom, "");

            Assert.IsNotNull(serverExplorerItem);
            var repo = new Mock <IExplorerServerResourceRepository>();
            var ws   = new Mock <IWorkspace>();

            repo.Setup(a => a.LoadDuplicate());
            ws.Setup(a => a.ID).Returns(Guid.Empty);
            FetchResourceDuplicates.ServerExplorerRepo = repo.Object;
            //------------Execute Test---------------------------
            FetchResourceDuplicates.Execute(new Dictionary <string, StringBuilder>(), ws.Object);
            //------------Assert Results-------------------------
            repo.Verify(a => a.LoadDuplicate());
        }