Пример #1
0
        public void Execute()
        {
            // Arrange
            Mock <IFileSystem> mockFs = CreateMockFileSystem();

            ExpectCreateDirectory(mockFs, @"X:\path_to_parent\Content");
            ExpectCreateDirectory(mockFs, @"X:\path_to_parent\Scripts");
            ExpectCreateDirectory(mockFs, @"X:\path_to_parent\Views\Billing");

            ExpectFileCopy(mockFs, @"X:\path_to_child\Content\FromChild.stuff", @"X:\path_to_parent\Content\FromChild.stuff");
            ExpectFileCopy(mockFs, @"X:\path_to_child\Views\Billing\FromChild.aspx", @"X:\path_to_parent\Views\Billing\FromChild.aspx");
            ExpectFileCopy(mockFs, @"X:\path_to_content\Content\FromContent.stuff", @"X:\path_to_parent\Content\FromContent.stuff");
            ExpectFileCopy(mockFs, @"X:\path_to_content\Scripts\SomeScript.js", @"X:\path_to_parent\Scripts\SomeScript.js");

            CopyAreaManifests task = new CopyAreaManifests()
            {
                ManifestPath = _manifestPath,
                FileSystem   = mockFs.Object
            };

            // Act
            bool retVal = task.Execute();

            // Assert
            Assert.IsTrue(retVal);
            mockFs.Verify();
        }
Пример #2
0
        public void Execute() {
            // Arrange
            Mock<IFileSystem> mockFs = CreateMockFileSystem();

            ExpectCreateDirectory(mockFs, @"X:\path_to_parent\Content");
            ExpectCreateDirectory(mockFs, @"X:\path_to_parent\Scripts");
            ExpectCreateDirectory(mockFs, @"X:\path_to_parent\Views\Billing");

            ExpectFileCopy(mockFs, @"X:\path_to_child\Content\FromChild.stuff", @"X:\path_to_parent\Content\FromChild.stuff");
            ExpectFileCopy(mockFs, @"X:\path_to_child\Views\Billing\FromChild.aspx", @"X:\path_to_parent\Views\Billing\FromChild.aspx");
            ExpectFileCopy(mockFs, @"X:\path_to_content\Content\FromContent.stuff", @"X:\path_to_parent\Content\FromContent.stuff");
            ExpectFileCopy(mockFs, @"X:\path_to_content\Scripts\SomeScript.js", @"X:\path_to_parent\Scripts\SomeScript.js");

            CopyAreaManifests task = new CopyAreaManifests() {
                ManifestPath = _manifestPath,
                FileSystem = mockFs.Object
            };

            // Act
            bool retVal = task.Execute();

            // Assert
            Assert.IsTrue(retVal);
            mockFs.Verify();
        }