public void PerformListOfIOPathOperation_AppendBackSlashes_Path_Null_ExpectNullReferenceException()
        {
            //-----------------------Arrange------------------------
            var mockActivityIOPath = new Mock <IActivityIOPath>();
            var mockFileWrapper    = new Mock <IFile>();
            var mockDirectory      = new Mock <IDirectory>();

            //-----------------------Act----------------------------
            //-----------------------Assert-------------------------
            Assert.ThrowsException <NullReferenceException>(() => PerformListOfIOPathOperation.AppendBackSlashes(mockActivityIOPath.Object, mockFileWrapper.Object, mockDirectory.Object));
        }
        public void PerformListOfIOPathOperation_AppendBackSlashes_With_CTOR_Path_Null_ExpectNullReferenceException()
        {
            //-----------------------Arrange------------------------
            var mockActivityIOPath = new Mock <IActivityIOPath>();
            var mockFileWrapper    = new Mock <IFile>();
            var mockDirectory      = new Mock <IDirectory>();
            var mockWindowsImpersonationContext = new Mock <IWindowsImpersonationContext>();

            var performListOfIOPathOperation = new TestPerformListOfIOPathOperation((arg1, arg2) => mockWindowsImpersonationContext.Object);

            //-----------------------Act----------------------------
            //-----------------------Assert-------------------------
            Assert.ThrowsException <NullReferenceException>(() => PerformListOfIOPathOperation.AppendBackSlashes(mockActivityIOPath.Object, mockFileWrapper.Object, mockDirectory.Object));
        }
        public void PerformListOfIOPathOperation_AppendBackSlashes_Path_IsNotDirectory_ExpectTrue()
        {
            //-----------------------Arrange------------------------
            var mockActivityIOPath = new Mock <IActivityIOPath>();
            var mockFileWrapper    = new Mock <IFile>();
            var mockDirectory      = new Mock <IDirectory>();

            var path = "ftp://testParth/logger.log";

            mockActivityIOPath.Setup(o => o.Path).Returns(path);
            //-----------------------Act----------------------------
            var appendBackSlashes = PerformListOfIOPathOperation.AppendBackSlashes(mockActivityIOPath.Object, mockFileWrapper.Object, mockDirectory.Object);

            //-----------------------Assert-------------------------
            mockActivityIOPath.VerifyAll();
            Assert.AreEqual(path, appendBackSlashes);
        }
        public void PerformListOfIOPathOperation_AppendBackSlashes_Path_IsNotNull_ExpectNullReferenceException()
        {
            //-----------------------Arrange------------------------
            var mockActivityIOPath = new Mock <IActivityIOPath>();
            var mockFileWrapper    = new Mock <IFile>();
            var mockDirectory      = new Mock <IDirectory>();

            var path = "TestPath";

            mockActivityIOPath.Setup(o => o.Path).Returns(path);
            //-----------------------Act----------------------------
            var appendBackSlashes = PerformListOfIOPathOperation.AppendBackSlashes(mockActivityIOPath.Object, mockFileWrapper.Object, mockDirectory.Object);

            //-----------------------Assert-------------------------
            mockActivityIOPath.VerifyAll();
            Assert.AreEqual(path + "\\", appendBackSlashes);
        }
        public void PerformListOfIOPathOperation_AppendBackSlashes_Path_IsDirectory_DirectoryExist_And_IsNotStarWildCard_ExpectTrue()
        {
            //-----------------------Arrange------------------------
            var mockActivityIOPath = new Mock <IActivityIOPath>();
            var mockFileWrapper    = new Mock <IFile>();
            var mockDirectory      = new Mock <IDirectory>();

            var path = "ftp://testParth/logger.log";

            mockActivityIOPath.Setup(o => o.Path).Returns(path);
            mockFileWrapper.Setup(o => o.Exists(It.IsAny <string>())).Returns(true);
            mockFileWrapper.Setup(o => o.GetAttributes(It.IsAny <string>())).Returns(FileAttributes.Directory);
            //-----------------------Act----------------------------
            var appendBackSlashes = PerformListOfIOPathOperation.AppendBackSlashes(mockActivityIOPath.Object, mockFileWrapper.Object, mockDirectory.Object);

            //-----------------------Assert-------------------------
            mockActivityIOPath.VerifyAll();
            mockFileWrapper.VerifyAll();
            Assert.AreEqual(path + "\\", appendBackSlashes);
        }