public void File_Constructs()
        {
            var filePath = Solutions.Tests.Helpers.WebResources.GenerateNew("root", "test");
            var service  = Solutions.Tests.Helpers.Service.Initialize();

            var webResourceSyncEngine = new WebResourceSyncEngine(Environment.CurrentDirectory + "\\root", service);

            Assert.IsInstanceOfType(webResourceSyncEngine, typeof(Microsoft.Xrm.DevOps.Solutions.WebResourceSyncEngine));
        }
        public void LocalAuthorityAndFile_Creates()
        {
            var relativefilePath = Solutions.Tests.Helpers.WebResources.GenerateNew("root", "test");
            var service          = Solutions.Tests.Helpers.Service.Initialize();

            var webResourceSyncEngine = new WebResourceSyncEngine(Environment.CurrentDirectory + "\\root", service);

            webResourceSyncEngine.ProcessWebResource(relativefilePath);

            var newFile = Solutions.Tests.Helpers.WebResources.FindOnline(service, relativefilePath);

            Assert.IsInstanceOfType(newFile, typeof(Microsoft.Xrm.Sdk.Entity));

            var action = webResourceSyncEngine.GetAction(relativefilePath);

            Assert.IsTrue(action == SyncAction.Create);

            Solutions.Tests.Helpers.WebResources.DeleteTmpFile(relativefilePath);
        }
        public void LocalAuthorityAndFileBothSides_Ignores()
        {
            var    relativefilePath  = Solutions.Tests.Helpers.WebResources.GenerateNew("root", "test");
            Entity webResourceEntity = new Entity("webresource", Guid.NewGuid());

            webResourceEntity["name"]    = relativefilePath;
            webResourceEntity["content"] = String.Empty;
            var service = Solutions.Tests.Helpers.Service.Initialize(webResourceEntity);

            var webResourceSyncEngine = new WebResourceSyncEngine(Environment.CurrentDirectory + "\\root", service);

            webResourceSyncEngine.ProcessWebResource(relativefilePath);

            var newFile = Solutions.Tests.Helpers.WebResources.FindOnline(service, relativefilePath);

            Assert.IsInstanceOfType(newFile, typeof(Microsoft.Xrm.Sdk.Entity));

            var action = webResourceSyncEngine.GetAction(relativefilePath);

            Assert.IsTrue(action == SyncAction.Ignore);

            Solutions.Tests.Helpers.WebResources.DeleteTmpFile(relativefilePath);
        }
        public void FolderNoConnection_Constructs()
        {
            var webResourceSyncEngine = new WebResourceSyncEngine(Environment.CurrentDirectory + "\\test", null);

            Assert.IsInstanceOfType(webResourceSyncEngine, typeof(Microsoft.Xrm.DevOps.Solutions.WebResourceSyncEngine));
        }
        public void NoFolderOrConnection_Constructs()
        {
            var webResourceSyncEngine = new WebResourceSyncEngine(String.Empty, null);

            Assert.IsInstanceOfType(webResourceSyncEngine, typeof(Microsoft.Xrm.DevOps.Solutions.WebResourceSyncEngine));
        }