{"id":23281989,"url":"https://github.com/bluedotbrigade/daten-lokator","last_synced_at":"2026-01-24T19:41:01.506Z","repository":{"id":39659945,"uuid":"343798459","full_name":"BlueDotBrigade/daten-lokator","owner":"BlueDotBrigade","description":"Streamline your automated .NET tests: load the right input with 1 line of code.","archived":false,"fork":false,"pushed_at":"2024-12-05T11:29:06.000Z","size":206,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2024-12-05T12:26:40.795Z","etag":null,"topics":["csharp","dotnet","tdd","testing","testing-framework","unit-testing"],"latest_commit_sha":null,"homepage":"https://datenlokator.bluedotbrigade.com","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/BlueDotBrigade.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"License.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-03-02T14:16:30.000Z","updated_at":"2024-12-05T11:29:56.000Z","dependencies_parsed_at":"2024-11-23T04:00:31.764Z","dependency_job_id":null,"html_url":"https://github.com/BlueDotBrigade/daten-lokator","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BlueDotBrigade%2Fdaten-lokator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BlueDotBrigade%2Fdaten-lokator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BlueDotBrigade%2Fdaten-lokator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BlueDotBrigade%2Fdaten-lokator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/BlueDotBrigade","download_url":"https://codeload.github.com/BlueDotBrigade/daten-lokator/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":230516200,"owners_count":18238353,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["csharp","dotnet","tdd","testing","testing-framework","unit-testing"],"created_at":"2024-12-20T00:13:31.353Z","updated_at":"2026-01-24T19:41:01.500Z","avatar_url":"https://github.com/BlueDotBrigade.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Daten Lokator\r\n\r\n[![.NET](https://github.com/BlueDotBrigade/daten-lokator/actions/workflows/dotnet.yml/badge.svg)](https://github.com/BlueDotBrigade/daten-lokator/actions/workflows/dotnet.yml)\r\n[![CodeQL](https://github.com/BlueDotBrigade/daten-lokator/actions/workflows/github-code-scanning/codeql/badge.svg)](https://github.com/BlueDotBrigade/daten-lokator/actions/workflows/github-code-scanning/codeql)\r\n\r\n- [Overview](#overview)\r\n- [Features](#features)\r\n- [Getting Started](#getting-started)\r\n   - [Sample Code](#sample-code)\r\n\r\n## Overview\r\n\r\n[BlueDotBrigade.DatenLokator][NuGetPackage] is a .NET _NuGet_ package that streamlines automated testing by allowing you to load input data with a single line of code, thus reducing visual noise and improving test comprehension. This library supports multiple data formats, automatic decompression, global caching, and run-time customization.\r\n\r\n## Features\r\n\r\n1. Retrieve data in different formats:\r\n   -\t`AsBytes()`\r\n   -\t`AsFile()`\r\n   -\t`AsString()`\r\n   -\t`AsStream()`\r\n   -\t`AsStreamReader()`\r\n   -\t`AsJson()`\r\n2. Automatic decompression of `*.zip` files.\r\n    -\tUseful for saving disk space.\r\n3. Global cache support.\r\n    - Useful when multiple tests consume the same file as input.\r\n4. Run-time customization.\r\n    - Can be used to specify where the input data will be stored.\r\n5. Extensible library.\r\n    - Create [extension methods][ExtensionMethod] to support custom target formats (e.g. `AsRecord()`).\r\n    - Implement the [ITestNamingStrategy][ITestNamingStrategy] interface to support custom test naming conventions.\r\n    - Implement the [IFileManagementStrategy][IFileManagementStrategy] interface for proprietary file management (e.g. cloud based storage).\r\n\r\n## Getting Started\r\n\r\nSetup:\r\n\r\n1. Create a .NET automated test project.\r\n   - For example: Using _Visual Studio_ add a _MsTest Test Project_ to your solution.\r\n   - _Daten Lokator_ will work with: _MsTest_, _NUnit_, _XUnit_, etc.\r\n2. Add the latest _NuGet_ package to your test project:\r\n   - [BlueDotBrigade.DatenLokator][NuGetPackage]\r\n3. The _Daten Lokator_ library must be initialized only **once** when the automated tests start.\r\n   - Example: `Lokator.Get().Setup()`\r\n   - If you are using _MsTest_ then consider doing this where the `AssemblyInitialize` attribute is used.\r\n4. Create a`.Daten` folder within the project (`*.csproj`) directory.\r\n   - Example: `/DemoTests/.Daten`\r\n   - Storing the input data within the project directory provides traceability, because now the input data can be committed to source control (e.g. *GitHub*).\r\n\r\nTest data sources and mock endpoints:\r\n- Instances of `Daten` can be used to load deterministic input fixtures from disk.\r\n- `Lokator.Register()` can be used to setup lightweight sockets that serve static content � useful for testing HTTP clients without an external server.\r\n\r\nManaging source files:\r\n\r\n1. Create an automated test.\r\n   - By default it is assumed that test method name follows the [Assert Act Arrange][AAA] naming convention.\r\n2. Save the input data in a file directory structure that mirrors the namespace.\r\n   - For example:\r\n      - **Unit Tests:** `/DemoTests/Serialization/XmlSerializerTests.cs`\r\n      - **Input Data:** `/DemoTests/.Daten/Serialization/XmlSerializerTests/*.*`\r\n   - Where:\r\n      - `.Daten` is _Daten Lokator_'s root directory for all input files.\r\n      - `Serialization` is the namespace where the `XmlSerializerTests.cs` automated tests can be found.\r\n3. When an input file is needed, simply call the appropriate `Daten` method from your automated test.\r\n   - For example: `new Daten().AsString()`\r\n\r\n### Sample Code\r\n\r\nThe following [unit tests][DemoTests], written for a trivial [application][DemoApp], demonstrate how:\r\n\r\n1. easy it is to use _Daten Lokator_, and \r\n2. how the library reduces visual noise thus making the test easier to read\r\n\r\n[DemoApp]: https://github.com/BlueDotBrigade/daten-lokator/tree/main/Src/Demo\r\n[DemoTests]: https://github.com/BlueDotBrigade/daten-lokator/blob/main/Tst/DemoTests/Serialization/XmlSerializerTests.cs\r\n\r\n[NuGetPackage]: https://www.nuget.org/packages/BlueDotBrigade.DatenLokator\r\n\r\n[AAA]: https://automationpanda.com/2020/07/07/arrange-act-assert-a-pattern-for-writing-good-tests/\r\n[ExtensionMethod]: https://learn.microsoft.com/en-us/dotnet/csharp/programming-guide/classes-and-structs/extension-methods\r\n[ITestNamingStrategy]: https://github.com/BlueDotBrigade/daten-lokator/blob/main/Src/BlueDotBrigade.DatenLokator.TestTools/NamingConventions/ITestNamingStrategy.cs\r\n[IFileManagementStrategy]: https://github.com/BlueDotBrigade/daten-lokator/blob/main/Src/BlueDotBrigade.DatenLokator.TestTools/IO/IFileManagementStrategy.cs\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbluedotbrigade%2Fdaten-lokator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbluedotbrigade%2Fdaten-lokator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbluedotbrigade%2Fdaten-lokator/lists"}