Exemplo n.º 1
0
        public void GetFileByName_UnexistingFileInRoot_IsNotFoundByNameWithoutSubdirs()
        {
            // Arrange
            TestSources testSources = new TestSources();
            string      fileName    = "IDoNotExist.ext";
            // Act
            ITestSourceItem testSourcesItem = testSources.GetFileByName(fileName, false);

            // Assert
            testSourcesItem.Should().BeNull();
        }
Exemplo n.º 2
0
        public void GetFileByName_FileInRoot_IsNotFoundByNameInLowerCase()
        {
            // Arrange
            TestSources testSources = new TestSources();
            string      fileName    = "binfile01.rar";
            // Act
            ITestSourceItem testSourcesItem = testSources.GetFileByName(fileName, false);

            // Assert
            testSourcesItem.Should().BeNull();
        }
Exemplo n.º 3
0
        public void GetFileByName_FileInFinalSubFolder_IsFoundByNameWithSubDirsImplicit()
        {
            // Arrange
            TestSources testSources = new TestSources();
            string      fileName    = "Sub2FolderBinFile.rar";
            // Act
            ITestSourceItem testSourcesItem = testSources.GetFileByName(fileName, true);

            // Assert
            testSourcesItem.Should().NotBeNull();
            testSourcesItem.Name.Should().Be(fileName);
        }
Exemplo n.º 4
0
        public void GetFileByName_FileInSubFolder_IsFoundByNameWithSubDirsExplicit()
        {
            // Arrange
            TestSources testSources = new TestSources();
            string      fileName    = "SomeJson.json";
            // Act
            ITestSourceItem testSourcesItem = testSources.GetFileByName(fileName, true);

            // Assert
            testSourcesItem.Should().NotBeNull();
            testSourcesItem.Name.Should().Be(fileName);
        }
Exemplo n.º 5
0
        public void GetFileByName_FileInRoot_IsFoundByNameIncludingSubDirs()
        {
            // Arrange
            TestSources testSources = new TestSources();
            string      fileName    = "BinFile01.rar";
            // Act
            ITestSourceItem testSourcesItem = testSources.GetFileByName(fileName, true);

            // Assert
            testSourcesItem.Should().NotBeNull();
            testSourcesItem.Name.Should().Be(fileName);
        }
Exemplo n.º 6
0
        public void GetFileByName_FileInRootAndFinalSubfolder_OnlyFirstFolderFileIsFound()
        {
            // Arrange
            TestSources testSources = new TestSources();
            string      fileName    = "TextFile01.txt";
            // Act
            ITestSourceItem testSourcesItem = testSources.GetFileByName(fileName, false);

            // Assert
            testSourcesItem.Should().NotBeNull();
            testSourcesItem.Name.Should().Be(fileName);
            testSourcesItem.Parent.Name.Should().Be(GetFileByNameTests.rootpath);
        }