public void ActivityIOBrokerValidatorDriver_ValidateZipSourceDestinationFileOperation_DstPathExists_ExpectException()
        {
            //---------------------------Arrange-----------------------------
            var mockActivityIOOperationsEndPointSrc = new Mock <IActivityIOOperationsEndPoint>();
            var mockActivityIOOperationsEndPointDst = new Mock <IActivityIOOperationsEndPoint>();
            var mockDev2ZipOperationTO = new Mock <IDev2ZipOperationTO>();
            var mockActivityIOPathSrc  = new Mock <IActivityIOPath>();
            var mockActivityIOPathDst  = new Mock <IActivityIOPath>();
            var mockFile   = new Mock <IFile>();
            var mockCommon = new Mock <ICommon>();

            const string dstPath = "C:\\Test_TempPath\\Temp_File.txt";

            mockActivityIOOperationsEndPointDst.Setup(o => o.IOPath).Returns(mockActivityIOPathDst.Object);

            mockActivityIOOperationsEndPointDst.Setup(o => o.PathSeperator()).Returns(@"\");

            mockActivityIOPathDst.Setup(o => o.Path).Returns(dstPath);

            mockActivityIOOperationsEndPointDst.Setup(o => o.PathExist(It.IsAny <IActivityIOPath>())).Returns(true);

            var driver = new ActivityIOBrokerValidatorDriver(mockFile.Object, mockCommon.Object);

            //---------------------------Act---------------------------------
            //---------------------------Assert------------------------------
            Assert.ThrowsException <Exception>(() => driver.ValidateZipSourceDestinationFileOperation(mockActivityIOOperationsEndPointSrc.Object, mockActivityIOOperationsEndPointDst.Object, mockDev2ZipOperationTO.Object, () => "test func"), "Destination file already exists and overwrite is set to false");
            mockActivityIOOperationsEndPointDst.VerifyAll();
            mockActivityIOOperationsEndPointSrc.VerifyAll();
            mockActivityIOPathSrc.VerifyAll();
            mockActivityIOPathDst.VerifyAll();
        }
        public void ActivityIOBrokerValidatorDriver_ValidateZipSourceDestinationFileOperation_SrcPathIs_Directory_ExpectException1()
        {
            //---------------------------Arrange-----------------------------
            var mockActivityIOOperationsEndPointSrc = new Mock <IActivityIOOperationsEndPoint>();
            var mockActivityIOOperationsEndPointDst = new Mock <IActivityIOOperationsEndPoint>();
            var mockDev2ZipOperationTO = new Mock <IDev2ZipOperationTO>();
            var mockActivityIOPathSrc  = new Mock <IActivityIOPath>();
            var mockActivityIOPathDst  = new Mock <IActivityIOPath>();
            var mockFile   = new Mock <IFile>();
            var mockCommon = new Mock <ICommon>();

            var          srcPath = Path.GetTempPath() + @"\Temp_SrcFile.txt";
            const string dstPath = "C:\\Test_TempPath\\Temp_File.txt";

            mockActivityIOOperationsEndPointDst.Setup(o => o.IOPath).Returns(mockActivityIOPathDst.Object);
            mockActivityIOOperationsEndPointSrc.Setup(o => o.IOPath).Returns(mockActivityIOPathSrc.Object);

            mockActivityIOOperationsEndPointDst.Setup(o => o.PathSeperator()).Returns(@"\");
            mockActivityIOOperationsEndPointSrc.Setup(o => o.PathSeperator()).Returns(@"\");
            mockActivityIOOperationsEndPointSrc.Setup(o => o.PathIs(It.IsAny <IActivityIOPath>())).Returns(enPathType.Directory);
            mockActivityIOOperationsEndPointDst.Setup(o => o.PathIs(It.IsAny <IActivityIOPath>())).Returns(enPathType.Directory);

            mockActivityIOOperationsEndPointDst.Setup(o => o.CreateDirectory(It.IsAny <IActivityIOPath>(), It.IsAny <IDev2CRUDOperationTO>())).Returns(true);

            mockActivityIOPathDst.Setup(o => o.Path).Returns(dstPath);
            mockActivityIOPathSrc.Setup(o => o.Path).Returns(srcPath);

            mockActivityIOOperationsEndPointDst.Setup(o => o.PathExist(It.IsAny <IActivityIOPath>())).Returns(false);

            var driver = new ActivityIOBrokerValidatorDriver(mockFile.Object, mockCommon.Object);
            //---------------------------Act---------------------------------
            var fileOperation = driver.ValidateZipSourceDestinationFileOperation(mockActivityIOOperationsEndPointSrc.Object, mockActivityIOOperationsEndPointDst.Object, mockDev2ZipOperationTO.Object, () => "test func");

            //---------------------------Assert------------------------------
            Assert.AreEqual("test func", fileOperation);
            mockActivityIOOperationsEndPointDst.VerifyAll();
            mockActivityIOOperationsEndPointSrc.VerifyAll();
            mockActivityIOPathSrc.VerifyAll();
            mockActivityIOPathDst.VerifyAll();
        }