Skip to content

Latest commit

 

History

History
31 lines (26 loc) · 724 Bytes

lines-attribute.md

File metadata and controls

31 lines (26 loc) · 724 Bytes

Lines attributes

Lines attributes return each line from the text content as the data.

Classes

  • EmbeddedResourceLinesAttribute
  • FileLinesAttribute

Capabilities

  • Allows multiple instances on single text method
  • Allows multiple parameters on test method

Samples

// Accepts a single file name.
// The test method is called for each line in the file content.
[Theory]
[FileLines("File1.txt")]
public void Single_file_lines_test(string line)
{
}

// You can also specify multiple files, one per attribute usage.
// The test method is called for each line in both files combined.
[Theory]
[FileLines("File1.txt")]
[FileLines("File2.txt")]
public void Multiple_files_test(string line)
{
}