public static void GetItems_Throws_WhenNotFound() { // Arrange var sourceTool = new FilesystemSourceTool(); var sourceInformation = new SourceInformation(SourceType.Filesystem, @"x:\A\B\C", true); // Act Assert.That( () => sourceTool.GetItems(sourceInformation), Throws.TypeOf <DirectoryNotFoundException>()); }
public static void GetItems_Succeeds([Values] bool isDirectory) { // Arrange var sourceTool = new FilesystemSourceTool(); var sourceInformation = isDirectory ? new SourceInformation(SourceType.Filesystem, @"C:\gh\AzureDevOpsLibrary", true) : new SourceInformation( SourceType.Filesystem, @"C:\gh\AzureDevOpsLibrary\AdoTools.Ado\AdoTools.Ado.csproj", false); // Act var result = sourceTool.GetItems( sourceInformation, isDirectory ? "*.csproj" : null); // Assert Assert.That(result, Is.Not.Null); Assert.That( result.Count(), Is.EqualTo( isDirectory ? 8 : 1)); try { var myHandlers = new VariableDumpHandlers(); Console.WriteLine(result.DumpValues(0, handlers: myHandlers)); } catch (ArgumentOutOfRangeException exception) { Console.WriteLine(exception); } }