public void ActivityIOBrokerValidatorDriver_ValidateUnzipSourceDestinationFileOperation_DestinationNotADirectory()
        {
            //---------------Set up test pack-------------------
            var driver = new ActivityIOBrokerValidatorDriver();

            var srcPath = Path.GetTempPath();
            var src     = new Mock <IActivityIOOperationsEndPoint>();

            src.Setup(point => point.IOPath.Path).Returns("");
            src.Setup(point => point.PathSeperator()).Returns(",");

            var dst = new Mock <IActivityIOOperationsEndPoint>();

            dst.SetupProperty(point => point.IOPath.Path);
            dst.Setup(point => point.PathSeperator()).Returns(",");
            var           args = new Dev2UnZipOperationTO("password", false);
            Func <string> performAfterValidation = () => "Success";

            src.Setup(point => point.IOPath.Path).Returns(srcPath);
            dst.Setup(point => point.IOPath.Path).Returns("");

            var hadException = false;

            try
            {
                driver.ValidateUnzipSourceDestinationFileOperation(src.Object, dst.Object, args, performAfterValidation);
            }
            catch (Exception ex1)
            {
                hadException = true;
                Assert.AreEqual(ErrorResource.DestinationMustBeADirectory, ex1.Message);
            }
            Assert.IsTrue(hadException);
        }
        public void ActivityIOBrokerValidatorDriver_ValidateUnzipSourceDestinationFileOperation_DestinationDirectoryExists()
        {
            //---------------Set up test pack-------------------
            var driver = new ActivityIOBrokerValidatorDriver();

            var srcPath = Path.GetTempPath();
            var src     = new Mock <IActivityIOOperationsEndPoint>();

            src.Setup(point => point.IOPath.Path).Returns("");
            src.Setup(point => point.PathSeperator()).Returns(",");

            var dst = new Mock <IActivityIOOperationsEndPoint>();

            dst.SetupProperty(point => point.IOPath.Path);
            dst.Setup(point => point.PathSeperator()).Returns(",");
            var           args = new Dev2UnZipOperationTO("password", false);
            Func <string> performAfterValidation = () => "Success";

            src.Setup(point => point.IOPath.Path).Returns(srcPath);
            dst.Setup(point => point.IOPath.Path).Returns("");

            dst.Setup(point => point.PathIs(It.IsAny <IActivityIOPath>())).Returns(enPathType.Directory);
            src.Setup(point => point.PathIs(It.IsAny <IActivityIOPath>())).Returns(enPathType.Directory);

            src.Setup(point => point.PathIs(It.IsAny <IActivityIOPath>())).Returns(enPathType.File);
            dst.Setup(point => point.PathExist(It.IsAny <IActivityIOPath>())).Returns(true);

            var hadException = false;

            try
            {
                driver.ValidateUnzipSourceDestinationFileOperation(src.Object, dst.Object, args, performAfterValidation);
            }
            catch (Exception ex3)
            {
                hadException = true;
                Assert.AreEqual(ErrorResource.DestinationDirectoryExist, ex3.Message);
                args = new Dev2UnZipOperationTO("pa", true);

                var invoke = driver.ValidateUnzipSourceDestinationFileOperation(src.Object, dst.Object, args, performAfterValidation);
                Assert.AreEqual(performAfterValidation.Invoke(), invoke.ToString());
            }
            Assert.IsTrue(hadException);
        }