public void FileAccess_ListTestAssemblyPaths_NotEmptyMatchingFilesToBeIncludedAndNotEmptyMatchingFilesToBeExcluded() { // Arrange var tempTestUnitFileName = Path.Combine(_netFrameworkDirectoryInfo.FullName, "Test.Unit.Access.Customer.dll"); var tempTestIntegrationFileName = Path.Combine(_netFrameworkDirectoryInfo.FullName, "Test.Integration.Access.Customer.dll"); using (var fs = new FileStream(tempTestUnitFileName, FileMode.Create)) { } using (var fs = new FileStream(tempTestIntegrationFileName, FileMode.Create)) { } var directory = _tempDirListTestAssemblyPathsTestsDirectoryInfo.FullName.ToLowerInvariant(); var minimatchPatterns = new string[] { "**\\Debug\\**\\*Test.Integration*.dll", "**\\Debug\\**\\*Test.Unit*.dll", "!**\\Debug\\**" }; var target = new FileAccessFactory().Create(); // Act var actual = target.ListTestAssemblyPaths(directory, minimatchPatterns.Select(x => x.ToLowerInvariant()).ToArray()); // Assert actual.Length.Should().Be(0); }
public void FileAccess_ListTestAssemblyPaths_NonExistingDirectoryPath() { // Arrange var directory = string.Empty; var minimatchPatterns = new string[0]; var target = new FileAccessFactory().Create(); // Act Action actual = () => target.ListTestAssemblyPaths(directory, minimatchPatterns.Select(x => x.ToLowerInvariant()).ToArray()); // Assert actual.Should().Throw <ArgumentException>(); }
public void FileAccess_ListTestAssemblyPaths_EmptyMatchingFilesToBeIncluded() { // Arrange var directory = _tempDirListTestAssemblyPathsTestsDirectoryInfo.FullName.ToLowerInvariant(); var minimatchPatterns = new string[] { "**\\Debug\\**\\*Test.Integration*.dll", "**\\Debug\\**\\*Test.Unit*.dll", "!**\\obj\\**" }; var target = new FileAccessFactory().Create(); // Act var actual = target.ListTestAssemblyPaths(directory, minimatchPatterns.Select(x => x.ToLowerInvariant()).ToArray()); // Assert actual.Should().BeNull(); }