### Disable All Scrubbing in C# Source: https://context7.com/verifytests/verify.closedxml/llms.txt Disables all automatic scrubbing for exact value verification in Excel files. This is useful when precise data matching is required, overriding default scrubbing behaviors like GUID and DateTime replacements. It requires the VerifyNUnit library. ```csharp using VerifyNUnit; [TestFixture] public class NoScrubbingTests { [Test] public Task DontScrub() => VerifyFile("sample.xlsx") .DontScrubGuids() .DontScrubDateTimes(); } ``` -------------------------------- ### Disable GUID Scrubbing in Verification Source: https://context7.com/verifytests/verify.closedxml/llms.txt Disables the default scrubbing of GUID values during verification. By using DontScrubGuids(), the actual GUID values from the Excel file will be retained in the verification output. This is useful when the exact GUIDs are important for your test assertions. ```csharp using VerifyNUnit; [TestFixture] public class GuidTests { [Test] public Task PreserveGuids() => VerifyFile("sample.xlsx") .DontScrubGuids(); } ``` -------------------------------- ### Initialize Verify.ClosedXml Source: https://github.com/verifytests/verify.closedxml/blob/main/readme.md Initializes the Verify.ClosedXml extension. This is typically done once per application domain, often using a module initializer. ```csharp using Verify.ClosedXml; using [ModuleInitializer] public static void Initialize() => VerifyClosedXml.Initialize(); ``` -------------------------------- ### Initialize Verify.ClosedXml Source: https://context7.com/verifytests/verify.closedxml/llms.txt Initializes the Verify.ClosedXml library by registering its Excel file converters with the Verify framework. This should be called once in your test project, typically using a module initializer, to enable automatic handling of .xlsx files. ```csharp using VerifyTests; public static class ModuleInitializer { [ModuleInitializer] public static void Initialize() => VerifyClosedXml.Initialize(); } ``` -------------------------------- ### Create and Verify XLWorkbook using C# Source: https://github.com/verifytests/verify.closedxml/blob/main/readme.md This snippet shows how to create a new ClosedXML workbook, add a worksheet, populate it with data, and then verify the workbook using the Verify library. It requires the ClosedXML and Verify NuGet packages. ```cs using ClosedXML.Excel; using NUnit.Framework; using System.Threading.Tasks; [Test] public Task XLWorkbook() { using var book = new XLWorkbook(); var sheet = book.Worksheets.Add("Basic Data"); sheet.Cell("A1").Value = "ID"; sheet.Cell("B1").Value = "Name"; sheet.Cell("A2").Value = 1; sheet.Cell("B2").Value = "John Doe"; sheet.Cell("A3").Value = 2; sheet.Cell("B3").Value = "Jane Smith"; return Verify(book); } ``` -------------------------------- ### Verify XLWorkbook Loaded from Stream Source: https://context7.com/verifytests/verify.closedxml/llms.txt Loads an existing Excel file into an XLWorkbook instance via a stream and then verifies it. This approach is useful when you need to perform manipulations on the workbook object after loading it from a file before proceeding with the verification. ```csharp using ClosedXML.Excel; using VerifyNUnit; [TestFixture] public class WorkbookStreamTests { [Test] public Task XLWorkbookFromStream() { using var stream = File.OpenRead("sample.xlsx"); using var book = new XLWorkbook(stream); return Verify(book); } } ``` -------------------------------- ### Verify Programmatically Created XLWorkbook Instance Source: https://context7.com/verifytests/verify.closedxml/llms.txt Verifies an Excel workbook created programmatically using ClosedXML's XLWorkbook class. This method is ideal for testing logic that generates Excel files, allowing direct verification of the workbook object before it's saved. ```csharp using ClosedXML.Excel; using VerifyNUnit; [TestFixture] public class WorkbookTests { [Test] public Task XLWorkbook() { using var book = new XLWorkbook(); var sheet = book.Worksheets.Add("Basic Data"); sheet.Cell("A1").Value = "ID"; sheet.Cell("B1").Value = "Name"; sheet.Cell("A2").Value = 1; sheet.Cell("B2").Value = "John Doe"; sheet.Cell("A3").Value = 2; sheet.Cell("B3").Value = "Jane Smith"; return Verify(book); } } ``` -------------------------------- ### Verify Excel File Source: https://github.com/verifytests/verify.closedxml/blob/main/readme.md Verifies an Excel file using the Verify.ClosedXml extension. This method takes the file path as input and returns a Task representing the asynchronous verification operation. ```csharp using VerifyTests; [Test] public Task VerifyExcel() => VerifyFile("sample.xlsx"); ``` -------------------------------- ### Verify Excel File from Disk Source: https://context7.com/verifytests/verify.closedxml/llms.txt Verifies an Excel (.xlsx) file directly from the file system. The library automatically converts the Excel file to CSV format and extracts relevant metadata for snapshot comparison. This method is straightforward for testing existing Excel files. ```csharp using VerifyNUnit; [TestFixture] public class ExcelTests { [Test] public Task VerifyExcel() => VerifyFile("sample.xlsx"); } ``` -------------------------------- ### Verify Multiple Sheets in C# Source: https://context7.com/verifytests/verify.closedxml/llms.txt Verifies Excel workbooks containing multiple sheets. The library automatically generates separate CSV files for each sheet, using the sheet name as a suffix for easy identification. This facilitates individual verification of content across different sheets within a single Excel file. It requires the VerifyNUnit library. ```csharp using VerifyNUnit; [TestFixture] public class MultiSheetTests { [Test] public Task MultipleSheets() => VerifyFile("sample_multiple_sheets.xlsx"); } // Output files generated: // - Samples.MultipleSheets.verified.txt (metadata) // - Samples.MultipleSheets#Sheet1.verified.csv // - Samples.MultipleSheets#Sheet2.verified.csv // - Samples.MultipleSheets.verified.xlsx ``` -------------------------------- ### Verify Excel Stream Source: https://github.com/verifytests/verify.closedxml/blob/main/readme.md Verifies an Excel file provided as a stream. This method reads the Excel file into a MemoryStream and then uses Verify to process it, specifying the 'xlsx' extension. ```csharp using System.IO; using VerifyTests; [Test] public Task VerifyExcelStream() { var stream = new MemoryStream(File.ReadAllBytes("sample.xlsx")); return Verify(stream, "xlsx"); } ``` -------------------------------- ### Verify Excel Stream Source: https://context7.com/verifytests/verify.closedxml/llms.txt Verifies Excel data provided as a memory stream. This is useful when dealing with dynamically generated Excel content or data retrieved from external sources. The stream is treated as an .xlsx file for verification purposes. ```csharp using VerifyNUnit; [TestFixture] public class ExcelStreamTests { [Test] public Task VerifyExcelStream() { var stream = new MemoryStream(File.ReadAllBytes("sample.xlsx")); return Verify(stream, "xlsx"); } } ``` -------------------------------- ### Disable DateTime Scrubbing in Verification Source: https://context7.com/verifytests/verify.closedxml/llms.txt Disables the default scrubbing of DateTime values during verification. By using DontScrubDateTimes(), the actual DateTime values present in the Excel file will be preserved in the verification output, ensuring that tests reflect the exact date and time information. ```csharp using VerifyNUnit; [TestFixture] public class DateTimeTests { [Test] public Task PreserveDateTimes() => VerifyFile("sample.xlsx") .DontScrubDateTimes(); } ``` -------------------------------- ### Disable Date Counting in C# Source: https://context7.com/verifytests/verify.closedxml/llms.txt Disables the date counting feature in Verify.ClosedXml, which normally replaces dates with sequential placeholders (e.g., DateTime_1, DateTime_2). This ensures that actual date values are preserved during verification. It requires the VerifyNUnit library. ```csharp using VerifyNUnit; [TestFixture] public class DateCountingTests { [Test] public Task DisableDateCounting() => VerifyFile("sample.xlsx") .DisableDateCounting(); } ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.