From a43f9ad382db69184a64827e36aafb8759857b29 Mon Sep 17 00:00:00 2001 From: stijnmoreels <9039753+stijnmoreels@users.noreply.github.com> Date: Fri, 27 Dec 2024 14:31:39 +0100 Subject: [PATCH 01/20] docs: add getting started page --- docs/preview/01-index.md | 19 +++- docs/preview/02-Features/01-core.md | 123 +++++++++++----------- docs/preview/02-Features/02-assertion.mdx | 4 + docs/preview/02-Features/03-logging.mdx | 4 + docs/preview/02-getting-started.md | 60 +++++++++++ 5 files changed, 144 insertions(+), 66 deletions(-) create mode 100644 docs/preview/02-getting-started.md diff --git a/docs/preview/01-index.md b/docs/preview/01-index.md index e6cedd20..25e48147 100644 --- a/docs/preview/01-index.md +++ b/docs/preview/01-index.md @@ -7,13 +7,24 @@ sidebar_position: 1 --- # Introduction -The Arcus Testing library provides test-friendly capabilities to kick-start your test suite. Ranges from tech-independent infrastructure code to fully production-ready assertions. The library contains also Azure-related test fixtures to make interactions during testing more maintainable, testable and fun to write. +Welcome to the Arcus Testing site! 🎉 -## Guides -* [Migrate from Testing Framework to Arcus.Testing v1.0](03-Guidance/migrate-from-testing-framework-to-arcus-testing-v1.0.mdx) +## What is Arcus Testing? +Arcus Testing is an umbrella term for a set of NuGet packages `Arcus.Testing.*` that help with the creation, maintenance, and defect localization of code testing. -# License +> 🎖️ Specifically designed to help with integration testing against Azure resources, but also helps with tech-independent infrastructure. + +In short: Arcus Testing is a set of libraries that make test more fun to write! + +## Why should I use Arcus Testing? +Testing is a fact of life. Writing those tests often comes with an effort to set up a test code infrastructure to interact with all the parts of the system. +Arcus Testing lessens the burden of re-creating the same boilerplate test code infrastructure for similar projects. + +## How to use Arcus Testing? +See our dedicated [getting started](02-getting-started.md) page to take your first steps with Arcus Testing. + +# License This is licensed under The MIT License (MIT). Which means that you can use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the web application. But you always need to state that Codit is the original author of this web application. _[Full license here](https://github.com/arcus-azure/arcus.testing/blob/master/LICENSE)_ diff --git a/docs/preview/02-Features/01-core.md b/docs/preview/02-Features/01-core.md index 24317c56..fd245d47 100644 --- a/docs/preview/02-Features/01-core.md +++ b/docs/preview/02-Features/01-core.md @@ -1,76 +1,19 @@ -# Test core infrastructure +--- +sidebar_label: Core infrastructure +--- +# Test core infrastructure The `Arcus.Testing.Core` package provides general testing infrastructure that is independent of technology, SUT (system-under-test) or testing framework. The features provided in this package are very often used and/or required for a functional integration/system test suite. ## Installation - The following infrastructure is available when installing this package: ```shell PM> Install-Package -Name Arcus.Testing.Core ``` -## Disposable collection - -The `DisposableCollection` provides a solution for when multiple temporary/disposable test fixtures need to be teared down independently from each other, meaning: when one test fixture fails, it should not stop another fixture from tearing down. Multiple synchronous/asynchronous test fixtures can be added to the collection. Upon disposing the collection itself, it will try to dispose each registered test fixture. When one or more failures occur, it will collect them and throw an `AggregateException`. - -```csharp -using Arcus.Testing; - -await using var disposables = new DisposableCollection(logger); - -disposables.Add(temporaryEnvironmentVariable); -disposables.Add(temporaryStorageState); - -// Dispose: -// - removing temporary environment variable -// - reverting storage state -``` - -### Customization - -The teardown of each test fixture will be retried, in case of a delay during network interaction, for example. - -```csharp -await using var disposables = new DisposableCollection(logger); - -// The amount of times a failed test fixture's disposal should be retried. -disposables.Options.RetryCount = 5; - -// The time interval between each failed test fixture's disposal retry. -disposables.Options.RetryInterval = TimeSpan.FromSeconds(5); -``` - -## Resource directory - -The `ResourceDirectory` provides a solution to retrieving local files during the test run. It points by default to the root output directory where the test suite is running, and from there any sub-directory can be navigated to in a test-friendly manner. Each time a directory or a file does not exists, an IO exception will be thrown with a clear message on what is missing on disk. - -```csharp -using Arcus.Testing; - -// Path: /bin/net8.0/ -ResourceDirectory root = ResourceDirectory.CurrentDirectory; - -string txt = root.ReadFileTextByName("file.txt"); -byte[] img = root.ReadFileBytesByName("file.png"); - -// Path: /bin/net8.0/resources -ResourceDirectory sub = root.WithSubDirectory("resources"); - -string txt = sub.ReadFileTextByName("file.txt"); -byte[] img = sub.ReadFileBytesByPattern("*.png"); - - -// FileNotFoundException: -// Cannot retrieve 'file.txt' file contents in test resource directory 'resources' because it does not exists, -// make sure that the test resource files are always copied to the output before loading their contents. -// File path: /bin/net8.0/resources/file.txt -// Resource directory: /bin/net8.0/resources -``` - ## Test configuration - The `TestConfig` (implements Microsoft's [`IConfiguration`](https://learn.microsoft.com/en-us/dotnet/api/microsoft.extensions.configuration.iconfiguration)) provides a solution on retrieving application configuration values during testing. Integration/system tests often require values that are only known at runtime. These values can be injected into an `appsettings.json` in your test project, but without a good configuration setup, retrieving and using those values can often be obscure (what with missing/blank values, for example?). The default `TestConfig` uses the `appsettings.json` as main file where the tokens could be set, for example: @@ -191,4 +134,60 @@ await Poll.Target(...) .StartAsync(); ``` -> 💡 Try to come up with a sweet spot that does not wait too long for the target resource, but takes enough margin to be run on any environment, in all conditions. \ No newline at end of file +> 💡 Try to come up with a sweet spot that does not wait too long for the target resource, but takes enough margin to be run on any environment, in all conditions. + +## Resource directory +The `ResourceDirectory` provides a solution to retrieving local files during the test run. It points by default to the root output directory where the test suite is running, and from there any sub-directory can be navigated to in a test-friendly manner. Each time a directory or a file does not exists, an IO exception will be thrown with a clear message on what is missing on disk. + +```csharp +using Arcus.Testing; + +// Path: /bin/net8.0/ +ResourceDirectory root = ResourceDirectory.CurrentDirectory; + +string txt = root.ReadFileTextByName("file.txt"); +byte[] img = root.ReadFileBytesByName("file.png"); + +// Path: /bin/net8.0/resources +ResourceDirectory sub = root.WithSubDirectory("resources"); + +string txt = sub.ReadFileTextByName("file.txt"); +byte[] img = sub.ReadFileBytesByPattern("*.png"); + + +// FileNotFoundException: +// Cannot retrieve 'file.txt' file contents in test resource directory 'resources' because it does not exists, +// make sure that the test resource files are always copied to the output before loading their contents. +// File path: /bin/net8.0/resources/file.txt +// Resource directory: /bin/net8.0/resources +``` + +## Disposable collection +The `DisposableCollection` provides a solution for when multiple temporary/disposable test fixtures need to be teared down independently from each other, meaning: when one test fixture fails, it should not stop another fixture from tearing down. Multiple synchronous/asynchronous test fixtures can be added to the collection. Upon disposing the collection itself, it will try to dispose each registered test fixture. When one or more failures occur, it will collect them and throw an `AggregateException`. + +```csharp +using Arcus.Testing; + +await using var disposables = new DisposableCollection(logger); + +disposables.Add(temporaryEnvironmentVariable); +disposables.Add(temporaryStorageState); + +// Dispose: +// - removing temporary environment variable +// - reverting storage state +``` + +### Customization + +The teardown of each test fixture will be retried, in case of a delay during network interaction, for example. + +```csharp +await using var disposables = new DisposableCollection(logger); + +// The amount of times a failed test fixture's disposal should be retried. +disposables.Options.RetryCount = 5; + +// The time interval between each failed test fixture's disposal retry. +disposables.Options.RetryInterval = TimeSpan.FromSeconds(5); +``` \ No newline at end of file diff --git a/docs/preview/02-Features/02-assertion.mdx b/docs/preview/02-Features/02-assertion.mdx index 8ef2f0af..e45d45f7 100644 --- a/docs/preview/02-Features/02-assertion.mdx +++ b/docs/preview/02-Features/02-assertion.mdx @@ -1,3 +1,7 @@ +--- +sidebar_label: Assertions +--- + import Tabs from '@theme/Tabs'; import TabItem from '@theme/TabItem'; diff --git a/docs/preview/02-Features/03-logging.mdx b/docs/preview/02-Features/03-logging.mdx index 4af39249..ea7ebc6f 100644 --- a/docs/preview/02-Features/03-logging.mdx +++ b/docs/preview/02-Features/03-logging.mdx @@ -1,3 +1,7 @@ +--- +sidebar_label: Logging +--- + import Tabs from '@theme/Tabs'; import TabItem from '@theme/TabItem'; diff --git a/docs/preview/02-getting-started.md b/docs/preview/02-getting-started.md new file mode 100644 index 00000000..44d772ed --- /dev/null +++ b/docs/preview/02-getting-started.md @@ -0,0 +1,60 @@ +--- +sidebar_label: Getting started +--- + +# Getting started with Arcus Testing +**Welcome to Arcus Testing! 🎉** + +This page is dedicated to be used as a walkthrough on how to integrate Arcus Testing in new and existing projects. + +## The basics +The libraries in Arcus Testing are split up in these main categories: +- **Core infrastructure** (contains tech-independent functionality) +- **Assertions** (contains ways to verify functionality) +- **Logging** (contains ways to use Microsoft's `ILogger` in your test project) +- **Technology fixtures** (contains ways to interact with technology in your tests) + +Depending on the context of your project, you might use one or more of these categories. The following guides will show you how these categories can be used in new or existing projects. + +## Step-by-step guides +> 🎉 All classes described here are available in the same namespace (`Arcus.Testing`), regardless which library you install. + +### Where does your integration tests get their values from? +Usually, integration tests projects need to have configuration values: HTTP endpoints of deployed applications, access keys to authenticate to a deployed service... In your project, these values might come in from environment variables, `appsettings.json` files, or other places. + +⚡ Arcus Testing provides a `TestConfig` class that implements Microsoft's `IConfiguration`. This class already has the `appsettings.json` and optional (local) `appsetting.local.json` files embedded upon creation. Meaning that you don't have to re-create this in each test project. + +1. Install the `Arcus.Testing.Core` NuGet package; +2. Locate the place where your tests retrieve their values; +3. Use the `var config = TestConfig.Create()` to create a default instance; +4. Use the common `config["Your:Config:Key]` syntax to retrieve your value. + +> 🔗 See [the dedicated feature documentation](./02-Features/01-core.md) for more information on this `Arcus.Testing.Core` package and what other common test operations you repeatably use, like polling, reading local files, etc. + +### Do you test if XML, JSON or CSV contents are equal? +Integration tests usually use content types like XML, JSON or CSV to pass data between systems. When asserting on whether the system used or transformed the data correctly, you have to do an 'equal' check on that data. The problem arises when elements are in a different order, have different casing or contain values that you don't care about, but are there anyway. + +⚡ Arcus Testing provides several `Assert[Xml/Json/Csv].Equal` classes to make this equalization check easier for you. Fully customizable with options to ignore elements, node order, and each time with a clear assertion failure message (including line number and element names) on what part is considered 'not equal'. + +1. Install the `Arcus.Testing.Assert` NuGet package; +2. Locate the places where you do an equalization check; +3. Load both the expected and actual contents as `string` (or `JsonNode`, `XmlDocument`...); +4. Use the `Assert[Xml/Json/Csv].Equal` method to check for equality. + +> 🔗 See [the dedicated feature documentation](./02-Features/02-assertion.mdx) for more information on this `Arcus.Testing.Assert` package and what other equalization and failure reporting options you can use. + +### Do you write log messages to the test output? +The test output is usually the first place you look when a test fails. Either the testing framework has written the exception message to the output, and assertion method has collected some failure message, or you have written some necessary context to understand (without debugging) why a test failed. + +Testing frameworks all have their different ways of writing log messages to the test output, which means that each piece of test code that interacts with these test framework-specifics, is more tightly coupled to that framework. + +⚡ Arcus Testing provides a way to use Microsoft's `ILogger` infrastructure in your tests instead of relying on test framework specifics. This way, you are free to write framework-independent test infrastructure. +It also helps with passing arguments to implementation code that relies on `ILogger`. + +1. Install the `Arcus.Testing.Logging.[Xunit/NUnit/MSTest]` package, according to your test framework; +2. Locate the places where you pass an `ILogger` or use the test framework-dependent logger. +3. Create an `new Xunit/NUnit/MSTestTestLogger(...)` instance that takes in the framework dependent logger. +4. Now, use the `ILogger`-implemented test logger instead. + +> 🔗 See [the dedicated feature documentation](.//02-Features/03-logging.mdx) for more information on these `Arcus.Testing.Logging.[Xunit/NUnit/MSTest]` packages. + From 04402f5bfe58a1fe6c835d1612553563d0a356a9 Mon Sep 17 00:00:00 2001 From: stijnmoreels <9039753+stijnmoreels@users.noreply.github.com> Date: Fri, 27 Dec 2024 14:34:47 +0100 Subject: [PATCH 02/20] pr-fix: higer level --- docs/preview/{02-getting-started.md => 01-getting-started.md} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename docs/preview/{02-getting-started.md => 01-getting-started.md} (100%) diff --git a/docs/preview/02-getting-started.md b/docs/preview/01-getting-started.md similarity index 100% rename from docs/preview/02-getting-started.md rename to docs/preview/01-getting-started.md From 52097715e9c3b078271e5b2b7ec0f2edb06ff915 Mon Sep 17 00:00:00 2001 From: stijnmoreels <9039753+stijnmoreels@users.noreply.github.com> Date: Fri, 27 Dec 2024 14:36:21 +0100 Subject: [PATCH 03/20] pr-fix: higer level --- docs/preview/01-index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/preview/01-index.md b/docs/preview/01-index.md index 25e48147..91434a8e 100644 --- a/docs/preview/01-index.md +++ b/docs/preview/01-index.md @@ -22,7 +22,7 @@ Testing is a fact of life. Writing those tests often comes with an effort to set Arcus Testing lessens the burden of re-creating the same boilerplate test code infrastructure for similar projects. ## How to use Arcus Testing? -See our dedicated [getting started](02-getting-started.md) page to take your first steps with Arcus Testing. +See our dedicated [getting started](01-getting-started.md) page to take your first steps with Arcus Testing. # License This is licensed under The MIT License (MIT). Which means that you can use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the web application. But you always need to state that Codit is the original author of this web application. From feb65b8ebf372b8be60b021255414538ceed2234 Mon Sep 17 00:00:00 2001 From: stijnmoreels <9039753+stijnmoreels@users.noreply.github.com> Date: Fri, 27 Dec 2024 14:37:43 +0100 Subject: [PATCH 04/20] pr-fix: higer level --- docs/preview/{01-index.md => 010-index.md} | 0 docs/preview/{01-getting-started.md => 011-getting-started.md} | 0 2 files changed, 0 insertions(+), 0 deletions(-) rename docs/preview/{01-index.md => 010-index.md} (100%) rename docs/preview/{01-getting-started.md => 011-getting-started.md} (100%) diff --git a/docs/preview/01-index.md b/docs/preview/010-index.md similarity index 100% rename from docs/preview/01-index.md rename to docs/preview/010-index.md diff --git a/docs/preview/01-getting-started.md b/docs/preview/011-getting-started.md similarity index 100% rename from docs/preview/01-getting-started.md rename to docs/preview/011-getting-started.md From f123d9330972d7ea1230a135b3d7962c6e93d659 Mon Sep 17 00:00:00 2001 From: stijnmoreels <9039753+stijnmoreels@users.noreply.github.com> Date: Fri, 27 Dec 2024 14:38:02 +0100 Subject: [PATCH 05/20] pr-fix: higer level --- docs/preview/{010-index.md => 01-index.md} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename docs/preview/{010-index.md => 01-index.md} (100%) diff --git a/docs/preview/010-index.md b/docs/preview/01-index.md similarity index 100% rename from docs/preview/010-index.md rename to docs/preview/01-index.md From c4886e719b335c7193fc943f8718a4b6686cfffb Mon Sep 17 00:00:00 2001 From: stijnmoreels <9039753+stijnmoreels@users.noreply.github.com> Date: Fri, 27 Dec 2024 14:40:16 +0100 Subject: [PATCH 06/20] pr-fix: higer level --- docs/preview/01-index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/preview/01-index.md b/docs/preview/01-index.md index 91434a8e..97b34c19 100644 --- a/docs/preview/01-index.md +++ b/docs/preview/01-index.md @@ -22,7 +22,7 @@ Testing is a fact of life. Writing those tests often comes with an effort to set Arcus Testing lessens the burden of re-creating the same boilerplate test code infrastructure for similar projects. ## How to use Arcus Testing? -See our dedicated [getting started](01-getting-started.md) page to take your first steps with Arcus Testing. +See our dedicated [getting started](011-getting-started.md) page to take your first steps with Arcus Testing. # License This is licensed under The MIT License (MIT). Which means that you can use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the web application. But you always need to state that Codit is the original author of this web application. From aa8568629619f4283189ac020581e07253855bb2 Mon Sep 17 00:00:00 2001 From: stijnmoreels <9039753+stijnmoreels@users.noreply.github.com> Date: Tue, 31 Dec 2024 06:16:11 +0100 Subject: [PATCH 07/20] pr-fix: correct docs order --- ...tting-started.md => 02-getting-started.md} | 29 ++++++++++++------- .../{02-Features => 03-Features}/01-core.md | 0 .../02-assertion.mdx | 0 .../03-logging.mdx | 0 .../04-Storage/01-storage-account.mdx | 0 .../04-Storage/02-cosmos.mdx | 0 .../05-Messaging/eventhubs-messsage-pump.md | 0 .../05-Messaging/servicebus-messsage-pump.md | 0 .../06-Integration/01-data-factory.mdx | 0 .../07-Security/inmemory-secret-provider.md | 0 .../_category_.yml | 0 .../_category_.yml | 0 ...esting-framework-to-arcus-testing-v1.0.mdx | 0 13 files changed, 18 insertions(+), 11 deletions(-) rename docs/preview/{011-getting-started.md => 02-getting-started.md} (68%) rename docs/preview/{02-Features => 03-Features}/01-core.md (100%) rename docs/preview/{02-Features => 03-Features}/02-assertion.mdx (100%) rename docs/preview/{02-Features => 03-Features}/03-logging.mdx (100%) rename docs/preview/{02-Features => 03-Features}/04-Storage/01-storage-account.mdx (100%) rename docs/preview/{02-Features => 03-Features}/04-Storage/02-cosmos.mdx (100%) rename docs/preview/{02-Features => 03-Features}/05-Messaging/eventhubs-messsage-pump.md (100%) rename docs/preview/{02-Features => 03-Features}/05-Messaging/servicebus-messsage-pump.md (100%) rename docs/preview/{02-Features => 03-Features}/06-Integration/01-data-factory.mdx (100%) rename docs/preview/{02-Features => 03-Features}/07-Security/inmemory-secret-provider.md (100%) rename docs/preview/{02-Features => 03-Features}/_category_.yml (100%) rename docs/preview/{03-Guidance => 04-Guidance}/_category_.yml (100%) rename docs/preview/{03-Guidance => 04-Guidance}/migrate-from-testing-framework-to-arcus-testing-v1.0.mdx (100%) diff --git a/docs/preview/011-getting-started.md b/docs/preview/02-getting-started.md similarity index 68% rename from docs/preview/011-getting-started.md rename to docs/preview/02-getting-started.md index 44d772ed..3082c04b 100644 --- a/docs/preview/011-getting-started.md +++ b/docs/preview/02-getting-started.md @@ -6,30 +6,37 @@ sidebar_label: Getting started **Welcome to Arcus Testing! 🎉** This page is dedicated to be used as a walkthrough on how to integrate Arcus Testing in new and existing projects. +Arcus Testing is an umbrella term for a set of NuGet packages that kick-start your code testing. ## The basics -The libraries in Arcus Testing are split up in these main categories: +The libraries in the Arcus Testing space are split up in these main categories: - **Core infrastructure** (contains tech-independent functionality) - **Assertions** (contains ways to verify functionality) - **Logging** (contains ways to use Microsoft's `ILogger` in your test project) - **Technology fixtures** (contains ways to interact with technology in your tests) -Depending on the context of your project, you might use one or more of these categories. The following guides will show you how these categories can be used in new or existing projects. +Depending on the context of your project, you might use one or more libraries in these categories. +The following guides will show you how to start with these categories in new or existing projects. ## Step-by-step guides -> 🎉 All classes described here are available in the same namespace (`Arcus.Testing`), regardless which library you install. +> 🎉 All classes described here are available in the same namespace : `Arcus.Testing`, regardless which library you install. -### Where does your integration tests get their values from? -Usually, integration tests projects need to have configuration values: HTTP endpoints of deployed applications, access keys to authenticate to a deployed service... In your project, these values might come in from environment variables, `appsettings.json` files, or other places. -⚡ Arcus Testing provides a `TestConfig` class that implements Microsoft's `IConfiguration`. This class already has the `appsettings.json` and optional (local) `appsetting.local.json` files embedded upon creation. Meaning that you don't have to re-create this in each test project. +
+

Where does your integration tests get their values from?

-1. Install the `Arcus.Testing.Core` NuGet package; -2. Locate the place where your tests retrieve their values; -3. Use the `var config = TestConfig.Create()` to create a default instance; -4. Use the common `config["Your:Config:Key]` syntax to retrieve your value. + Usually, integration tests projects need to have configuration values: HTTP endpoints of deployed applications, access keys to authenticate to a deployed service... In your project, these values might come in from environment variables, `appsettings.json` files, or other places. -> 🔗 See [the dedicated feature documentation](./02-Features/01-core.md) for more information on this `Arcus.Testing.Core` package and what other common test operations you repeatably use, like polling, reading local files, etc. + ⚡ Arcus Testing provides a `TestConfig` class that implements Microsoft's `IConfiguration`. This class already has the `appsettings.json` and optional (local) `appsetting.local.json` files embedded upon creation. Meaning that you don't have to re-create this in each test project. + + 1. Install the `Arcus.Testing.Core` NuGet package; + 2. Locate the place where your tests retrieve their values; + 3. Use the `var config = TestConfig.Create()` to create a default instance; + 4. Use the common `config["Your:Config:Key]` syntax to retrieve your value. + + > 🔗 See [the dedicated feature documentation](./02-Features/01-core.md) for more information on this `Arcus.Testing.Core` package and what other common test operations you repeatably use, like polling, reading local files, etc. + +
### Do you test if XML, JSON or CSV contents are equal? Integration tests usually use content types like XML, JSON or CSV to pass data between systems. When asserting on whether the system used or transformed the data correctly, you have to do an 'equal' check on that data. The problem arises when elements are in a different order, have different casing or contain values that you don't care about, but are there anyway. diff --git a/docs/preview/02-Features/01-core.md b/docs/preview/03-Features/01-core.md similarity index 100% rename from docs/preview/02-Features/01-core.md rename to docs/preview/03-Features/01-core.md diff --git a/docs/preview/02-Features/02-assertion.mdx b/docs/preview/03-Features/02-assertion.mdx similarity index 100% rename from docs/preview/02-Features/02-assertion.mdx rename to docs/preview/03-Features/02-assertion.mdx diff --git a/docs/preview/02-Features/03-logging.mdx b/docs/preview/03-Features/03-logging.mdx similarity index 100% rename from docs/preview/02-Features/03-logging.mdx rename to docs/preview/03-Features/03-logging.mdx diff --git a/docs/preview/02-Features/04-Storage/01-storage-account.mdx b/docs/preview/03-Features/04-Storage/01-storage-account.mdx similarity index 100% rename from docs/preview/02-Features/04-Storage/01-storage-account.mdx rename to docs/preview/03-Features/04-Storage/01-storage-account.mdx diff --git a/docs/preview/02-Features/04-Storage/02-cosmos.mdx b/docs/preview/03-Features/04-Storage/02-cosmos.mdx similarity index 100% rename from docs/preview/02-Features/04-Storage/02-cosmos.mdx rename to docs/preview/03-Features/04-Storage/02-cosmos.mdx diff --git a/docs/preview/02-Features/05-Messaging/eventhubs-messsage-pump.md b/docs/preview/03-Features/05-Messaging/eventhubs-messsage-pump.md similarity index 100% rename from docs/preview/02-Features/05-Messaging/eventhubs-messsage-pump.md rename to docs/preview/03-Features/05-Messaging/eventhubs-messsage-pump.md diff --git a/docs/preview/02-Features/05-Messaging/servicebus-messsage-pump.md b/docs/preview/03-Features/05-Messaging/servicebus-messsage-pump.md similarity index 100% rename from docs/preview/02-Features/05-Messaging/servicebus-messsage-pump.md rename to docs/preview/03-Features/05-Messaging/servicebus-messsage-pump.md diff --git a/docs/preview/02-Features/06-Integration/01-data-factory.mdx b/docs/preview/03-Features/06-Integration/01-data-factory.mdx similarity index 100% rename from docs/preview/02-Features/06-Integration/01-data-factory.mdx rename to docs/preview/03-Features/06-Integration/01-data-factory.mdx diff --git a/docs/preview/02-Features/07-Security/inmemory-secret-provider.md b/docs/preview/03-Features/07-Security/inmemory-secret-provider.md similarity index 100% rename from docs/preview/02-Features/07-Security/inmemory-secret-provider.md rename to docs/preview/03-Features/07-Security/inmemory-secret-provider.md diff --git a/docs/preview/02-Features/_category_.yml b/docs/preview/03-Features/_category_.yml similarity index 100% rename from docs/preview/02-Features/_category_.yml rename to docs/preview/03-Features/_category_.yml diff --git a/docs/preview/03-Guidance/_category_.yml b/docs/preview/04-Guidance/_category_.yml similarity index 100% rename from docs/preview/03-Guidance/_category_.yml rename to docs/preview/04-Guidance/_category_.yml diff --git a/docs/preview/03-Guidance/migrate-from-testing-framework-to-arcus-testing-v1.0.mdx b/docs/preview/04-Guidance/migrate-from-testing-framework-to-arcus-testing-v1.0.mdx similarity index 100% rename from docs/preview/03-Guidance/migrate-from-testing-framework-to-arcus-testing-v1.0.mdx rename to docs/preview/04-Guidance/migrate-from-testing-framework-to-arcus-testing-v1.0.mdx From 8c75b800e450620555d8a236f095d8b01b926b89 Mon Sep 17 00:00:00 2001 From: stijnmoreels <9039753+stijnmoreels@users.noreply.github.com> Date: Tue, 31 Dec 2024 06:19:24 +0100 Subject: [PATCH 08/20] pr-fix: correct docs order --- docs/preview/02-getting-started.md | 6 +++--- ...esting-framework-to-arcus-testing-v1.0.mdx | 20 +++++++++---------- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/docs/preview/02-getting-started.md b/docs/preview/02-getting-started.md index 3082c04b..9cd58e54 100644 --- a/docs/preview/02-getting-started.md +++ b/docs/preview/02-getting-started.md @@ -34,7 +34,7 @@ The following guides will show you how to start with these categories in new or 3. Use the `var config = TestConfig.Create()` to create a default instance; 4. Use the common `config["Your:Config:Key]` syntax to retrieve your value. - > 🔗 See [the dedicated feature documentation](./02-Features/01-core.md) for more information on this `Arcus.Testing.Core` package and what other common test operations you repeatably use, like polling, reading local files, etc. + > 🔗 See [the dedicated feature documentation](./03-Features/01-core.md) for more information on this `Arcus.Testing.Core` package and what other common test operations you repeatably use, like polling, reading local files, etc. @@ -48,7 +48,7 @@ Integration tests usually use content types like XML, JSON or CSV to pass data b 3. Load both the expected and actual contents as `string` (or `JsonNode`, `XmlDocument`...); 4. Use the `Assert[Xml/Json/Csv].Equal` method to check for equality. -> 🔗 See [the dedicated feature documentation](./02-Features/02-assertion.mdx) for more information on this `Arcus.Testing.Assert` package and what other equalization and failure reporting options you can use. +> 🔗 See [the dedicated feature documentation](./03-Features/02-assertion.mdx) for more information on this `Arcus.Testing.Assert` package and what other equalization and failure reporting options you can use. ### Do you write log messages to the test output? The test output is usually the first place you look when a test fails. Either the testing framework has written the exception message to the output, and assertion method has collected some failure message, or you have written some necessary context to understand (without debugging) why a test failed. @@ -63,5 +63,5 @@ It also helps with passing arguments to implementation code that relies on `ILog 3. Create an `new Xunit/NUnit/MSTestTestLogger(...)` instance that takes in the framework dependent logger. 4. Now, use the `ILogger`-implemented test logger instead. -> 🔗 See [the dedicated feature documentation](.//02-Features/03-logging.mdx) for more information on these `Arcus.Testing.Logging.[Xunit/NUnit/MSTest]` packages. +> 🔗 See [the dedicated feature documentation](./03-Features/03-logging.mdx) for more information on these `Arcus.Testing.Logging.[Xunit/NUnit/MSTest]` packages. diff --git a/docs/preview/04-Guidance/migrate-from-testing-framework-to-arcus-testing-v1.0.mdx b/docs/preview/04-Guidance/migrate-from-testing-framework-to-arcus-testing-v1.0.mdx index 4ae92afd..f2f39e2c 100644 --- a/docs/preview/04-Guidance/migrate-from-testing-framework-to-arcus-testing-v1.0.mdx +++ b/docs/preview/04-Guidance/migrate-from-testing-framework-to-arcus-testing-v1.0.mdx @@ -94,7 +94,7 @@ Any nodes that should be ignored can be configured by passing additional options + }); ``` -🔗 See the [feature documentation](../02-Features/02-assertion.mdx) for more info on the `AssertJson` and the available options. +🔗 See the [feature documentation](../03-Features/02-assertion.mdx) for more info on the `AssertJson` and the available options. @@ -138,7 +138,7 @@ string actualCsv = ...; + }); ``` -🔗 See the [feature documentation](../02-Features/02-assertion.mdx) for more info on the `AssertCsv` and the available options. +🔗 See the [feature documentation](../03-Features/02-assertion.mdx) for more info on the `AssertCsv` and the available options. @@ -202,7 +202,7 @@ Here's how XML-JSON now works: > 💡You can use the test-friendly `AssertXml/Json/Xslt.Load` functionality to load raw contents to their respectful XSLT/XML/JSON document. Upon failure, a load exception with a detailed description will be reported to the tester. -> 💡 You can use the test-friendly [`ResourceDirectory`](../02-Features/01-core.md) functionality in the `Arcus.Testing.Core` package to load raw file contents. Upon failure, a not-found exception with a detailed description will be reported to the tester. +> 💡 You can use the test-friendly [`ResourceDirectory`](../03-Features/01-core.md) functionality in the `Arcus.Testing.Core` package to load raw file contents. Upon failure, a not-found exception with a detailed description will be reported to the tester. @@ -230,10 +230,10 @@ Here's how XML-CSV now works: > 💡You can use the test-friendly `AssertXml/Csv/Xslt.Load` functionality to load raw contents to their respectful XSLT/XML/CSV document. Upon failure, a load exception with a detailed description will be reported to the tester. -> 💡 You can use the test-friendly [`ResourceDirectory`](../02-Features/01-core.md) functionality in the `Arcus.Testing.Core` package to load raw file contents. Upon failure, a not-found exception with a detailed description will be reported to the tester. +> 💡 You can use the test-friendly [`ResourceDirectory`](../03-Features/01-core.md) functionality in the `Arcus.Testing.Core` package to load raw file contents. Upon failure, a not-found exception with a detailed description will be reported to the tester. -🔗 See the [feature documentation](../02-Features/02-assertion.mdx) for more info on the `AssertXslt`. +🔗 See the [feature documentation](../03-Features/02-assertion.mdx) for more info on the `AssertXslt`. @@ -327,7 +327,7 @@ Starting DataFlow's in a debug session is now linked to the `TemporaryDataFlowDe ### Run a Data pipeline Arcus does not provide any additional functionality to run a pipeline and wait for its result, as all this can be easily done with the [`Azure.ResourceManager.DataFactory`](https://learn.microsoft.com/en-us/dotnet/api/overview/azure/resourcemanager.datafactory-readme?view=azure-dotnet) and [`Arcus.Testing.Core`](../02-Features/01-core.md) packages. -🔗 See the [feature documentation](../02-Features/06-Integration/01-data-factory.mdx) for more information on testing DataFactory functionality. +🔗 See the [feature documentation](../03-Features/06-Integration/01-data-factory.mdx) for more information on testing DataFactory functionality. ## Replace storage account interactions @@ -364,7 +364,7 @@ The testing framework separated storage operations, which are now collected in a + await client.GetBlobsAsync(BlobTraits.None, BlobStates.None, ""); ``` -🔗 See the [feature documentation](../02-Features/04-Storage/01-storage-account.mdx) for more information on interacting with Blob storage. +🔗 See the [feature documentation](../03-Features/04-Storage/01-storage-account.mdx) for more information on interacting with Blob storage. ### Interact with Blob file The testing framework separated storage operations, which are now collected in a single `TemporaryBlobFile` test fixture. Based on the needs of the test, the fixture can be adapted. Interacting with the file can be done with the Azure SDK. @@ -387,7 +387,7 @@ The testing framework separated storage operations, which are now collected in a + BlobClient = file.Client; ``` -🔗 See the [feature documentation](../02-Features/04-Storage/01-storage-account.mdx) for more information on interacting with Blob storage. +🔗 See the [feature documentation](../03-Features/04-Storage/01-storage-account.mdx) for more information on interacting with Blob storage. @@ -427,7 +427,7 @@ The testing framework separated storage operations, which are now collected in a + await table.AddEntityAsync(); ``` -🔗 See the [feature documentation](../02-Features/04-Storage/01-storage-account.mdx) for more information on interacting with Table storage. +🔗 See the [feature documentation](../03-Features/04-Storage/01-storage-account.mdx) for more information on interacting with Table storage. @@ -472,4 +472,4 @@ The testing framework separated storage operations, which are now collected in a + await container.AddItemAsync(); ``` -🔗 See the [feature documentation](../02-Features/04-Storage/02-cosmos.mdx) for more information on interacting with Cosmos NoSql storage. \ No newline at end of file +🔗 See the [feature documentation](../03-Features/04-Storage/02-cosmos.mdx) for more information on interacting with Cosmos NoSql storage. \ No newline at end of file From 3944c5d64d03ec27d6bcf7e1a608fb8c687e1117 Mon Sep 17 00:00:00 2001 From: stijnmoreels <9039753+stijnmoreels@users.noreply.github.com> Date: Tue, 31 Dec 2024 06:21:24 +0100 Subject: [PATCH 09/20] pr-fix: correct docs order --- ...te-from-testing-framework-to-arcus-testing-v1.0.mdx | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/docs/preview/04-Guidance/migrate-from-testing-framework-to-arcus-testing-v1.0.mdx b/docs/preview/04-Guidance/migrate-from-testing-framework-to-arcus-testing-v1.0.mdx index f2f39e2c..b3b14a2d 100644 --- a/docs/preview/04-Guidance/migrate-from-testing-framework-to-arcus-testing-v1.0.mdx +++ b/docs/preview/04-Guidance/migrate-from-testing-framework-to-arcus-testing-v1.0.mdx @@ -22,7 +22,7 @@ Start by installing this library: PM > Install-Package -Name Arcus.Testing.Assert ``` -🔗 See the [feature documentation](../02-Features/02-assertion.mdx) for more info on the supported assertions. +🔗 See the [feature documentation](../03-Features/02-assertion.mdx) for more info on the supported assertions. 🔗 See the [code samples](https://github.com/arcus-azure/arcus.testing/tree/main/samples) for fully-implemented examples on before/after with the Testing Framework. @@ -59,7 +59,7 @@ Any nodes that should be ignored can be configured by passing additional options + }); ``` -🔗 See the [feature documentation](../02-Features/02-assertion.mdx) for more info on the `AssertXml`. +🔗 See the [feature documentation](../03-Features/02-assertion.mdx) for more info on the `AssertXml`. @@ -174,7 +174,7 @@ Here's how XML-XML now works: > 💡You can use the test-friendly `AssertXml/Xslt.Load` functionality to load raw contents to their respectful XSLT/XML document. Upon failure, a load exception with a detailed description will be reported to the tester. -> 💡 You can use the test-friendly [`ResourceDirectory`](../02-Features/01-core.md) functionality in the `Arcus.Testing.Core` package to load raw file contents. Upon failure, a not-found exception with a detailed description will be reported to the tester. +> 💡 You can use the test-friendly [`ResourceDirectory`](../03-Features/01-core.md) functionality in the `Arcus.Testing.Core` package to load raw file contents. Upon failure, a not-found exception with a detailed description will be reported to the tester. @@ -322,10 +322,10 @@ Starting DataFlow's in a debug session is now linked to the `TemporaryDataFlowDe + AssertJson.Equal(expected, actual); ``` -> ⚡ Assertion is now separated also from the run operation. [Arcus.Testing.Assert](../02-Features/02-assertion.mdx) can be used to assert on the available sink result. +> ⚡ Assertion is now separated also from the run operation. [Arcus.Testing.Assert](../03-Features/02-assertion.mdx) can be used to assert on the available sink result. ### Run a Data pipeline -Arcus does not provide any additional functionality to run a pipeline and wait for its result, as all this can be easily done with the [`Azure.ResourceManager.DataFactory`](https://learn.microsoft.com/en-us/dotnet/api/overview/azure/resourcemanager.datafactory-readme?view=azure-dotnet) and [`Arcus.Testing.Core`](../02-Features/01-core.md) packages. +Arcus does not provide any additional functionality to run a pipeline and wait for its result, as all this can be easily done with the [`Azure.ResourceManager.DataFactory`](https://learn.microsoft.com/en-us/dotnet/api/overview/azure/resourcemanager.datafactory-readme?view=azure-dotnet) and [`Arcus.Testing.Core`](../03-Features/01-core.md) packages. 🔗 See the [feature documentation](../03-Features/06-Integration/01-data-factory.mdx) for more information on testing DataFactory functionality. From 5c143fe04ea7e0994f414827d4067ee0dfe2c4c7 Mon Sep 17 00:00:00 2001 From: stijnmoreels <9039753+stijnmoreels@users.noreply.github.com> Date: Tue, 31 Dec 2024 06:23:29 +0100 Subject: [PATCH 10/20] pr-fix: correct docs order --- docs/preview/01-index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/preview/01-index.md b/docs/preview/01-index.md index 97b34c19..25e48147 100644 --- a/docs/preview/01-index.md +++ b/docs/preview/01-index.md @@ -22,7 +22,7 @@ Testing is a fact of life. Writing those tests often comes with an effort to set Arcus Testing lessens the burden of re-creating the same boilerplate test code infrastructure for similar projects. ## How to use Arcus Testing? -See our dedicated [getting started](011-getting-started.md) page to take your first steps with Arcus Testing. +See our dedicated [getting started](02-getting-started.md) page to take your first steps with Arcus Testing. # License This is licensed under The MIT License (MIT). Which means that you can use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the web application. But you always need to state that Codit is the original author of this web application. From 4671ffba1d1db3d5b42006dbe990dd22794696a3 Mon Sep 17 00:00:00 2001 From: stijnmoreels <9039753+stijnmoreels@users.noreply.github.com> Date: Tue, 31 Dec 2024 06:36:17 +0100 Subject: [PATCH 11/20] pr-fix: add tech package in getting started --- docs/preview/02-getting-started.md | 54 ++++++++++++++++++++---------- 1 file changed, 36 insertions(+), 18 deletions(-) diff --git a/docs/preview/02-getting-started.md b/docs/preview/02-getting-started.md index 9cd58e54..a9c07d7a 100644 --- a/docs/preview/02-getting-started.md +++ b/docs/preview/02-getting-started.md @@ -23,7 +23,7 @@ The following guides will show you how to start with these categories in new or
-

Where does your integration tests get their values from?

+

Where do your integration tests get their values from?

Usually, integration tests projects need to have configuration values: HTTP endpoints of deployed applications, access keys to authenticate to a deployed service... In your project, these values might come in from environment variables, `appsettings.json` files, or other places. @@ -38,30 +38,48 @@ The following guides will show you how to start with these categories in new or
-### Do you test if XML, JSON or CSV contents are equal? -Integration tests usually use content types like XML, JSON or CSV to pass data between systems. When asserting on whether the system used or transformed the data correctly, you have to do an 'equal' check on that data. The problem arises when elements are in a different order, have different casing or contain values that you don't care about, but are there anyway. +
+

Do you test if XML, JSON or CSV contents are equal?

+ Integration tests usually use content types like XML, JSON or CSV to pass data between systems. When asserting on whether the system used or transformed the data correctly, you have to do an 'equal' check on that data. The problem arises when elements are in a different order, have different casing or contain values that you don't care about, but are there anyway. -⚡ Arcus Testing provides several `Assert[Xml/Json/Csv].Equal` classes to make this equalization check easier for you. Fully customizable with options to ignore elements, node order, and each time with a clear assertion failure message (including line number and element names) on what part is considered 'not equal'. + ⚡ Arcus Testing provides several `Assert[Xml/Json/Csv].Equal` classes to make this equalization check easier for you. Fully customizable with options to ignore elements, node order, and each time with a clear assertion failure message (including line number and element names) on what part is considered 'not equal'. -1. Install the `Arcus.Testing.Assert` NuGet package; -2. Locate the places where you do an equalization check; -3. Load both the expected and actual contents as `string` (or `JsonNode`, `XmlDocument`...); -4. Use the `Assert[Xml/Json/Csv].Equal` method to check for equality. + 1. Install the `Arcus.Testing.Assert` NuGet package; + 2. Locate the places where you do an equalization check; + 3. Load both the expected and actual contents as `string` (or `JsonNode`, `XmlDocument`...); + 4. Use the `Assert[Xml/Json/Csv].Equal` method to check for equality. -> 🔗 See [the dedicated feature documentation](./03-Features/02-assertion.mdx) for more information on this `Arcus.Testing.Assert` package and what other equalization and failure reporting options you can use. + > 🔗 See [the dedicated feature documentation](./03-Features/02-assertion.mdx) for more information on this `Arcus.Testing.Assert` package and what other equalization and failure reporting options you can use. +
-### Do you write log messages to the test output? -The test output is usually the first place you look when a test fails. Either the testing framework has written the exception message to the output, and assertion method has collected some failure message, or you have written some necessary context to understand (without debugging) why a test failed. +
+

Do you write log messages to the test output?

+ The test output is usually the first place you look when a test fails. Either the testing framework has written the exception message to the output, and assertion method has collected some failure message, or you have written some necessary context to understand (without debugging) why a test failed. -Testing frameworks all have their different ways of writing log messages to the test output, which means that each piece of test code that interacts with these test framework-specifics, is more tightly coupled to that framework. + Testing frameworks all have their different ways of writing log messages to the test output, which means that each piece of test code that interacts with these test framework-specifics, is more tightly coupled to that framework. -⚡ Arcus Testing provides a way to use Microsoft's `ILogger` infrastructure in your tests instead of relying on test framework specifics. This way, you are free to write framework-independent test infrastructure. + ⚡ Arcus Testing provides a way to use Microsoft's `ILogger` infrastructure in your tests instead of relying on test framework specifics. This way, you are free to write framework-independent test infrastructure. It also helps with passing arguments to implementation code that relies on `ILogger`. -1. Install the `Arcus.Testing.Logging.[Xunit/NUnit/MSTest]` package, according to your test framework; -2. Locate the places where you pass an `ILogger` or use the test framework-dependent logger. -3. Create an `new Xunit/NUnit/MSTestTestLogger(...)` instance that takes in the framework dependent logger. -4. Now, use the `ILogger`-implemented test logger instead. + 1. Install the `Arcus.Testing.Logging.[Xunit/NUnit/MSTest]` package, according to your test framework; + 2. Locate the places where you pass an `ILogger` or use the test framework-dependent logger. + 3. Create an `new Xunit/NUnit/MSTestTestLogger(...)` instance that takes in the framework dependent logger. + 4. Now, use the `ILogger`-implemented test logger instead. + + > 🔗 See [the dedicated feature documentation](./03-Features/03-logging.mdx) for more information on these `Arcus.Testing.Logging.[Xunit/NUnit/MSTest]` packages. +
+ +
+

Do you interact with Azure resources in your test?

+ Integration-like tests (meaning: tests that interact with resources outside the code environment), often need additional test infrastructure to interact with those resources in a test-friendly way. If a resource store a state, you might want to clear the state at the end of the test, for example. + + ⚡ Arcus Testing provides several Azure technology-specific packages that helps with this interaction. If your system is interacting with Azure Blob storage, you can use the `TemporaryBlobContainer` in the `Arcus.Testing.Storage.Blob` package, which clears up any lingering state before/after the actual test. + + In the same fashion, Arcus Testing has packages for all sorts of Azure technologies, each time with the test-usability in mind. -> 🔗 See [the dedicated feature documentation](./03-Features/03-logging.mdx) for more information on these `Arcus.Testing.Logging.[Xunit/NUnit/MSTest]` packages. + > 🔗 See the following dedicated feature documentation pages for more information on interacting with your technology in your test: + > * [Storage Account](./03-Features/04-Storage/01-storage-account.mdx) + > * [Data Factory](./03-Features/06-Integration/01-data-factory.mdx) + > * See the sidebar for more technologies. +
\ No newline at end of file From 644d6bd5ee00e73112aea3537f7191c66ddb5453 Mon Sep 17 00:00:00 2001 From: stijnmoreels <9039753+stijnmoreels@users.noreply.github.com> Date: Tue, 31 Dec 2024 06:46:14 +0100 Subject: [PATCH 12/20] pr-fix: add tech package in getting started --- docs/preview/02-getting-started.md | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/docs/preview/02-getting-started.md b/docs/preview/02-getting-started.md index a9c07d7a..b8a18a43 100644 --- a/docs/preview/02-getting-started.md +++ b/docs/preview/02-getting-started.md @@ -23,7 +23,7 @@ The following guides will show you how to start with these categories in new or
-

Where do your integration tests get their values from?

+ Where do your integration tests get their values from? Usually, integration tests projects need to have configuration values: HTTP endpoints of deployed applications, access keys to authenticate to a deployed service... In your project, these values might come in from environment variables, `appsettings.json` files, or other places. @@ -39,7 +39,7 @@ The following guides will show you how to start with these categories in new or
-

Do you test if XML, JSON or CSV contents are equal?

+ Do you test if XML, JSON or CSV contents are equal? Integration tests usually use content types like XML, JSON or CSV to pass data between systems. When asserting on whether the system used or transformed the data correctly, you have to do an 'equal' check on that data. The problem arises when elements are in a different order, have different casing or contain values that you don't care about, but are there anyway. ⚡ Arcus Testing provides several `Assert[Xml/Json/Csv].Equal` classes to make this equalization check easier for you. Fully customizable with options to ignore elements, node order, and each time with a clear assertion failure message (including line number and element names) on what part is considered 'not equal'. @@ -50,10 +50,11 @@ The following guides will show you how to start with these categories in new or 4. Use the `Assert[Xml/Json/Csv].Equal` method to check for equality. > 🔗 See [the dedicated feature documentation](./03-Features/02-assertion.mdx) for more information on this `Arcus.Testing.Assert` package and what other equalization and failure reporting options you can use. +
-

Do you write log messages to the test output?

+ Do you write log messages to the test output? The test output is usually the first place you look when a test fails. Either the testing framework has written the exception message to the output, and assertion method has collected some failure message, or you have written some necessary context to understand (without debugging) why a test failed. Testing frameworks all have their different ways of writing log messages to the test output, which means that each piece of test code that interacts with these test framework-specifics, is more tightly coupled to that framework. @@ -67,10 +68,11 @@ It also helps with passing arguments to implementation code that relies on `ILog 4. Now, use the `ILogger`-implemented test logger instead. > 🔗 See [the dedicated feature documentation](./03-Features/03-logging.mdx) for more information on these `Arcus.Testing.Logging.[Xunit/NUnit/MSTest]` packages. +
-

Do you interact with Azure resources in your test?

+ Do you interact with Azure resources in your test? Integration-like tests (meaning: tests that interact with resources outside the code environment), often need additional test infrastructure to interact with those resources in a test-friendly way. If a resource store a state, you might want to clear the state at the end of the test, for example. ⚡ Arcus Testing provides several Azure technology-specific packages that helps with this interaction. If your system is interacting with Azure Blob storage, you can use the `TemporaryBlobContainer` in the `Arcus.Testing.Storage.Blob` package, which clears up any lingering state before/after the actual test. From 957f72f2356508b3576b259c73d2e5be7b38f627 Mon Sep 17 00:00:00 2001 From: stijnmoreels <9039753+stijnmoreels@users.noreply.github.com> Date: Tue, 31 Dec 2024 06:53:42 +0100 Subject: [PATCH 13/20] pr-fix: add tech package in getting started --- docs/preview/02-getting-started.md | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/docs/preview/02-getting-started.md b/docs/preview/02-getting-started.md index b8a18a43..8cc46d9b 100644 --- a/docs/preview/02-getting-started.md +++ b/docs/preview/02-getting-started.md @@ -39,7 +39,8 @@ The following guides will show you how to start with these categories in new or
- Do you test if XML, JSON or CSV contents are equal? + How do you handle assertions for data equality? + Integration tests usually use content types like XML, JSON or CSV to pass data between systems. When asserting on whether the system used or transformed the data correctly, you have to do an 'equal' check on that data. The problem arises when elements are in a different order, have different casing or contain values that you don't care about, but are there anyway. ⚡ Arcus Testing provides several `Assert[Xml/Json/Csv].Equal` classes to make this equalization check easier for you. Fully customizable with options to ignore elements, node order, and each time with a clear assertion failure message (including line number and element names) on what part is considered 'not equal'. @@ -50,11 +51,12 @@ The following guides will show you how to start with these categories in new or 4. Use the `Assert[Xml/Json/Csv].Equal` method to check for equality. > 🔗 See [the dedicated feature documentation](./03-Features/02-assertion.mdx) for more information on this `Arcus.Testing.Assert` package and what other equalization and failure reporting options you can use. -
+
Do you write log messages to the test output? + The test output is usually the first place you look when a test fails. Either the testing framework has written the exception message to the output, and assertion method has collected some failure message, or you have written some necessary context to understand (without debugging) why a test failed. Testing frameworks all have their different ways of writing log messages to the test output, which means that each piece of test code that interacts with these test framework-specifics, is more tightly coupled to that framework. @@ -68,11 +70,11 @@ It also helps with passing arguments to implementation code that relies on `ILog 4. Now, use the `ILogger`-implemented test logger instead. > 🔗 See [the dedicated feature documentation](./03-Features/03-logging.mdx) for more information on these `Arcus.Testing.Logging.[Xunit/NUnit/MSTest]` packages. -
Do you interact with Azure resources in your test? + Integration-like tests (meaning: tests that interact with resources outside the code environment), often need additional test infrastructure to interact with those resources in a test-friendly way. If a resource store a state, you might want to clear the state at the end of the test, for example. ⚡ Arcus Testing provides several Azure technology-specific packages that helps with this interaction. If your system is interacting with Azure Blob storage, you can use the `TemporaryBlobContainer` in the `Arcus.Testing.Storage.Blob` package, which clears up any lingering state before/after the actual test. @@ -83,5 +85,4 @@ It also helps with passing arguments to implementation code that relies on `ILog > * [Storage Account](./03-Features/04-Storage/01-storage-account.mdx) > * [Data Factory](./03-Features/06-Integration/01-data-factory.mdx) > * See the sidebar for more technologies. -
\ No newline at end of file From b2eb270941a72d3089580415571408844dac15a2 Mon Sep 17 00:00:00 2001 From: stijnmoreels <9039753+stijnmoreels@users.noreply.github.com> Date: Tue, 31 Dec 2024 07:02:02 +0100 Subject: [PATCH 14/20] pr-fix: group technology libraries --- docs/preview/02-getting-started.md | 4 ++-- .../04-Storage/01-storage-account.mdx | 0 .../{ => 04-Technology}/04-Storage/02-cosmos.mdx | 0 .../06-Integration/01-data-factory.mdx | 0 ...te-from-testing-framework-to-arcus-testing-v1.0.mdx | 10 +++++----- 5 files changed, 7 insertions(+), 7 deletions(-) rename docs/preview/03-Features/{ => 04-Technology}/04-Storage/01-storage-account.mdx (100%) rename docs/preview/03-Features/{ => 04-Technology}/04-Storage/02-cosmos.mdx (100%) rename docs/preview/03-Features/{ => 04-Technology}/06-Integration/01-data-factory.mdx (100%) diff --git a/docs/preview/02-getting-started.md b/docs/preview/02-getting-started.md index 8cc46d9b..80d3c24c 100644 --- a/docs/preview/02-getting-started.md +++ b/docs/preview/02-getting-started.md @@ -82,7 +82,7 @@ It also helps with passing arguments to implementation code that relies on `ILog In the same fashion, Arcus Testing has packages for all sorts of Azure technologies, each time with the test-usability in mind. > 🔗 See the following dedicated feature documentation pages for more information on interacting with your technology in your test: - > * [Storage Account](./03-Features/04-Storage/01-storage-account.mdx) - > * [Data Factory](./03-Features/06-Integration/01-data-factory.mdx) + > * [Storage Account](./03-Features/04-Technology/04-Storage/01-storage-account.mdx) + > * [Data Factory](./03-Features/04-Technology/06-Integration/01-data-factory.mdx) > * See the sidebar for more technologies. \ No newline at end of file diff --git a/docs/preview/03-Features/04-Storage/01-storage-account.mdx b/docs/preview/03-Features/04-Technology/04-Storage/01-storage-account.mdx similarity index 100% rename from docs/preview/03-Features/04-Storage/01-storage-account.mdx rename to docs/preview/03-Features/04-Technology/04-Storage/01-storage-account.mdx diff --git a/docs/preview/03-Features/04-Storage/02-cosmos.mdx b/docs/preview/03-Features/04-Technology/04-Storage/02-cosmos.mdx similarity index 100% rename from docs/preview/03-Features/04-Storage/02-cosmos.mdx rename to docs/preview/03-Features/04-Technology/04-Storage/02-cosmos.mdx diff --git a/docs/preview/03-Features/06-Integration/01-data-factory.mdx b/docs/preview/03-Features/04-Technology/06-Integration/01-data-factory.mdx similarity index 100% rename from docs/preview/03-Features/06-Integration/01-data-factory.mdx rename to docs/preview/03-Features/04-Technology/06-Integration/01-data-factory.mdx diff --git a/docs/preview/04-Guidance/migrate-from-testing-framework-to-arcus-testing-v1.0.mdx b/docs/preview/04-Guidance/migrate-from-testing-framework-to-arcus-testing-v1.0.mdx index b3b14a2d..f25dd6c8 100644 --- a/docs/preview/04-Guidance/migrate-from-testing-framework-to-arcus-testing-v1.0.mdx +++ b/docs/preview/04-Guidance/migrate-from-testing-framework-to-arcus-testing-v1.0.mdx @@ -327,7 +327,7 @@ Starting DataFlow's in a debug session is now linked to the `TemporaryDataFlowDe ### Run a Data pipeline Arcus does not provide any additional functionality to run a pipeline and wait for its result, as all this can be easily done with the [`Azure.ResourceManager.DataFactory`](https://learn.microsoft.com/en-us/dotnet/api/overview/azure/resourcemanager.datafactory-readme?view=azure-dotnet) and [`Arcus.Testing.Core`](../03-Features/01-core.md) packages. -🔗 See the [feature documentation](../03-Features/06-Integration/01-data-factory.mdx) for more information on testing DataFactory functionality. +🔗 See the [feature documentation](../03-Features/04-Technology/06-Integration/01-data-factory.mdx) for more information on testing DataFactory functionality. ## Replace storage account interactions @@ -364,7 +364,7 @@ The testing framework separated storage operations, which are now collected in a + await client.GetBlobsAsync(BlobTraits.None, BlobStates.None, ""); ``` -🔗 See the [feature documentation](../03-Features/04-Storage/01-storage-account.mdx) for more information on interacting with Blob storage. +🔗 See the [feature documentation](../03-Features/04-Technology/04-Storage/01-storage-account.mdx) for more information on interacting with Blob storage. ### Interact with Blob file The testing framework separated storage operations, which are now collected in a single `TemporaryBlobFile` test fixture. Based on the needs of the test, the fixture can be adapted. Interacting with the file can be done with the Azure SDK. @@ -387,7 +387,7 @@ The testing framework separated storage operations, which are now collected in a + BlobClient = file.Client; ``` -🔗 See the [feature documentation](../03-Features/04-Storage/01-storage-account.mdx) for more information on interacting with Blob storage. +🔗 See the [feature documentation](../03-Features/04-Technology/04-Storage/01-storage-account.mdx) for more information on interacting with Blob storage.
@@ -427,7 +427,7 @@ The testing framework separated storage operations, which are now collected in a + await table.AddEntityAsync(); ``` -🔗 See the [feature documentation](../03-Features/04-Storage/01-storage-account.mdx) for more information on interacting with Table storage. +🔗 See the [feature documentation](../03-Features/04-Technology/04-Storage/01-storage-account.mdx) for more information on interacting with Table storage. @@ -472,4 +472,4 @@ The testing framework separated storage operations, which are now collected in a + await container.AddItemAsync(); ``` -🔗 See the [feature documentation](../03-Features/04-Storage/02-cosmos.mdx) for more information on interacting with Cosmos NoSql storage. \ No newline at end of file +🔗 See the [feature documentation](../03-Features/04-Technology/04-Storage/02-cosmos.mdx) for more information on interacting with Cosmos NoSql storage. \ No newline at end of file From 7a2cfcc41ef322f7ffabeb32a25d5b0cd40908be Mon Sep 17 00:00:00 2001 From: stijnmoreels <9039753+stijnmoreels@users.noreply.github.com> Date: Tue, 31 Dec 2024 07:02:48 +0100 Subject: [PATCH 15/20] pr-fix: remove in-memory messaging/security --- .../05-Messaging/eventhubs-messsage-pump.md | 183 ----------------- .../05-Messaging/servicebus-messsage-pump.md | 187 ------------------ .../07-Security/inmemory-secret-provider.md | 93 --------- 3 files changed, 463 deletions(-) delete mode 100644 docs/preview/03-Features/05-Messaging/eventhubs-messsage-pump.md delete mode 100644 docs/preview/03-Features/05-Messaging/servicebus-messsage-pump.md delete mode 100644 docs/preview/03-Features/07-Security/inmemory-secret-provider.md diff --git a/docs/preview/03-Features/05-Messaging/eventhubs-messsage-pump.md b/docs/preview/03-Features/05-Messaging/eventhubs-messsage-pump.md deleted file mode 100644 index 557b7ac6..00000000 --- a/docs/preview/03-Features/05-Messaging/eventhubs-messsage-pump.md +++ /dev/null @@ -1,183 +0,0 @@ ---- -title: Testing Azure EventHubs message handling -layout: default ---- - -# Testing Azure EventHubs message handling - -## Installation - -Install this package to easily test your EventHubs message handlers: - -```shell -PM> Install-Package -Name Arcus.Testing.Messaging.Pumps.EventHubs -``` - -## Test Azure EventHubs message pump - -As an addition on the [Arcus Azure EventHubs message pump](https://messaging.arcus-azure.net/Features/message-handling/event-hubs), we have provided a test version of the message pump to verify your custom Azure EventHubs message handler implementations. -These handler implementations can be tested separately, and could be tested by interacting with the message router directly, but simulating messages like it would be from Azure EventHubs itself is a bit trickier. -This test message pump functionality allows you to verify certain cases without the need of an actual Azure resource. - -We provide an extension that acts as an Azure EventHubs message pump and lets you decide how messages should be produced. - -Consider the following message handler implementations to test: - -```csharp -using Arcus.Messaging.Abstractions; -using Arcus.Messaging.Abstractions.EventHubs; -using Arcus.Messaging.Abstractions.EventHubs.MessageHandling; - -public class SensorReadingAzureEventHubsMessageHandler : IAzureEventHubsMessageHandler -{ - public async Task ProcessMessageAsync( - SensorReading reading, - AzureEventHubsMessageContext context, - MessageCorrelationInfo correlationInfo, - CancellationToken cancellationToken) - { - // Process sensor reading... - } -} - -public class SensorTelemetryAzureEventHubsMessageHandler : IAzureEventHubsMessageHandler -{ - public async Task ProcessMessageAsync( - SensorTelemetry telemetry, - AzureEventHubsMessageContext context, - MessageCorrelationInfo correlationInfo, - CancellationToken cancellationToken) - { - // Process sensor telemetry... - } -} -``` - -Testing these together requires us to register them into an application. The following example shows how instead of calling `.AddEventHubsMessagePump(...)`, you can call the testing variant `.AddTestEventHubsMessagePump(...)`. -The extension allows you to pass in a 'message producer'. This producer allows you to control which kind of messages the test message pump should simulate. This example shows how a single `SensorReading` message can be added to the message pump. - -```csharp -using System; -using Xunit; -using Microsoft.Extensions.DependencyInjection; -using Microsoft.Extensions.Hosting; -using Microsoft.Extensions.Logging; - -public class MessageHandlingTests -{ - private readonly ITestOutputWriter _outputWriter; - - public MessageHandlingTests(ITestOutputWriter outputWriter) - { - _outputWriter = outputWriter; - } - - [Fact] - public async Task RegisterSensorReadingAndSensorTelemetryMessageHandler_PublishSensorReading_ProcessSensorReadingCorrectly() - { - // Arrange - var reading = new SensorReading(sensorId: "123", timestamp: DateTimeOffset.UtcNow); - var handler = new SensorReadingAzureEventHubsMessageHandler(); - - IHostBuilder builder = - Host.CreateDefaultBuilder() - .ConfigureLogging(logging => logging.AddXunitTestLogging(_outputWriter)) - .ConfigureServices(services => - { - services.AddTestEventHubsMessagePump(producer => producer.AddMessageBody(reading)) - .WithEventHubsMessageHandler(provider => handler) - .WithEventHubsMessageHandler(); - }); - - using (IHost host = builder.Build()) - { - try - { - // Act - host.StartAsync(); - - // Assert - Assert.True(handler.IsProcessed); - } - finally - { - await host.StopAsync(); - } - } - } -} -``` - -Note that in this example, we use `Assert.True(handler.IsProcessed)` to determine if the `SensorReading` message was correctly processed. In your application, you may want to inject your message handlers with test versions of dependencies and determine via those dependencies if the correct message handler was called. -You can use one of the `.WithEventHubsMessageHandler<,>(...)` extensions to pass in your instance of the message handler so you can use it later in the test assertion, like it is shown in the example. - -> 💡 Note that the example uses `logging.AddXunitTestLogging`. This is available in the `Arcus.Testing.Logging.Xunit` package. See [this page on logging](../03-logging.mdx) for more information. - -## Message producer configuration - -The test message pump can be configured extensively to meet your needs. You can even pass in your own implementation of a test message producer to have full control over how the Azure EventHubs messages should look like. -When a custom message body is passed, an `EventHubsReceivedMessage` will be created with the [correlation properties](https://messaging.arcus-azure.net/Features/message-handling/service-bus#message-correlation) already filled out. This allows for you to also test any the correlation specific functionality in your message handlers. - -```csharp -services.AddTestEventHubsMessagePump(producer => -{ - // Pass in a single custom message, which will become a `EventData`. - producer.AddMessageBody(sensorReading); - - // Pass in multiple custom messages, which will become `EventData` instances. - producer.AddMessageBodies(sensorReadings); - - // Pass in your own `EventData`. - // 💡 Use Arcus' `EventDataBuilder` to create such messages. - EventData message = - EventDataBuilder.CreateForBody(BinaryData.FromObjectAsJson(sensorReading)) - .Build(); - producer.AddMessage(message); - - // Pass in your own `EventHubsReceivedMessage` instances. - // 💡 Use Arcus' `EventDataBuilder` to create such messages. - EventData message = - EventDataBuilder.CreateForBody(BinaryData.FromObjectAsJson(sensorReading)) - .Build(); - producer.AddMessages(new[] { message }); -}); -``` - -If the creation of Azure EventHubs messages is rather complex, you require asynchronous serialization, or you want to re-use your message producing; you can implement your own message producer. -This requires you to implement the `IAzureEventHubsMessageProducer` interface. - -```csharp -public class MyTestMessageProducer : IAzureEventHubsMessageProducer -{ - public async Task ProduceMessagesAsync() - { - var reading = new SensorReading(sensorId: "123", timestamp: DateTimeOffset.UtcNow); - - EventData message = - EventDataBuilder.CreateForBody(BinaryData.FromObjectAsJson(reading)) - .Build(); - - return Task.FromResult(new[] { message }); - } -} -``` - -Such implementation can be passed along during the registration: - -```csharp -var producer = new MyTestMessageProducer(); -services.AddTestEventHubsMessagePump(producer); -``` - -## Message routing configuration - -The test Azure EventHubs registration internally uses the Azure EventHubs message router. To configure this router, use one of the extension overloads. This gives you access to the message router options, like in a general Azure EventHubs message pump registration. - -```csharp -services.AddTestEventHubsMessagePump(..., options => -{ - options.Deserialization.AdditionalMembers = AdditionalMemberHandling.Error -}); -``` - -For more information on the message router options, see the [Arcus messaging feature documentation](https://messaging.arcus-azure.net/Features/message-handling/event-hubs#pump-configuration). diff --git a/docs/preview/03-Features/05-Messaging/servicebus-messsage-pump.md b/docs/preview/03-Features/05-Messaging/servicebus-messsage-pump.md deleted file mode 100644 index ac51f3a6..00000000 --- a/docs/preview/03-Features/05-Messaging/servicebus-messsage-pump.md +++ /dev/null @@ -1,187 +0,0 @@ ---- -title: Testing Azure Service Bus message handling -layout: default ---- - -# Testing Azure Service Bus message handling - -## Installation - -Install this package to easily test your Service Bus message handlers: - -```shell -PM> Install-Package -Name Arcus.Testing.Messaging.Pumps.ServiceBus -``` - -## Test Azure Service Bus message pump - -As an addition on the [Arcus Azure Service Bus message pump](https://messaging.arcus-azure.net/Features/message-handling/service-bus), we have provided a test version of the message pump to verify your custom Azure Service Bus message handler implementations. -These handler implementations can be tested separately, and could be tested by interacting with the message router directly, but simulating messages like it would be from Azure Service Bus itself is a bit trickier. -This test message pump functionality allows you to verify certain cases without the need of an actual Azure resource. - -We provide an extension that acts as an Azure Service Bus message pump and lets you decide how messages should be produced. - -Consider the following message handler implementations to test: - -```csharp -using Arcus.Messaging.Abstractions; -using Arcus.Messaging.Abstractions.ServiceBus; -using Arcus.Messaging.Abstractions.ServiceBus.MessageHandling; - -public class OrderAzureServiceBusMessageHandler : IAzureServiceBusMessageHandler -{ - public async Task ProcessMessageAsync( - Order message, - AzureServiceBusMessageContext context, - MessageCorrelationInfo correlationInfo, - CancellationToken cancellationToken) - { - // Process order... - } -} - -public class ShipmentAzureServiceBusMessageHandler : IAzureServiceBusMessageHandler -{ - public async Task ProcessMessageAsync( - Shipment message, - AzureServiceBusMessageContext context, - MessageCorrelationInfo correlationInfo, - CancellationToken cancellationToken) - { - // Process shipment... - } -} -``` - -Testing these together requires us to register them into an application. The following example shows how instead of calling `.AddServiceBusMessagePump(...)`, you can call the testing variant `.AddTestServiceBusMessagePump(...)`. -The extension allows you to pass in a 'message producer'. This producer allows you to control which kind of messages the test message pump should simulate. This example shows how a single `Order` message can be added to the message pump. - -```csharp -using System; -using Xunit; -using Microsoft.Extensions.DependencyInjection; -using Microsoft.Extensions.Hosting; -using Microsoft.Extensions.Logging; - -public class MessageHandlingTests -{ - private readonly ITestOutputWriter _outputWriter; - - public MessageHandlingTests(ITestOutputWriter outputWriter) - { - _outputWriter = outputWriter; - } - - [Fact] - public async Task RegisterOrderAndShipmentMessageHandler_PublishOrder_ProcessOrderCorrectly() - { - // Arrange - var order = new Order(orderId: "123", scheduled: DateTimeOffset.UtcNow); - var handler = new OrderAzureServiceBusMessageHandler(); - - IHostBuilder builder = - Host.CreateDefaultBuilder() - .ConfigureLogging(logging => logging.AddXunitTestLogging(_outputWriter)) - .ConfigureServices(services => - { - services.AddTestServiceBusMessagePump(producer => producer.AddMessageBody(order)) - .WithServiceBusMessageHandler(provider => handler) - .WithServiceBusMessageHandler(); - }); - - using (IHost host = builder.Build()) - { - try - { - // Act - host.StartAsync(); - - // Assert - Assert.True(handler.IsProcessed); - } - finally - { - await host.StopAsync(); - } - } - } -} -``` - -Note that in this example, we use `Assert.True(handler.IsProcessed)` to determine if the `Order` message was correctly processed. In your application, you may want to inject your message handlers with test versions of dependencies and determine via those dependencies if the correct message handler was called. -You can use one of the `.WithServiceBusMessageHandler<,>(...)` extensions to pass in your instance of the message handler so you can use it later in the test assertion, like it is shown in the example. - -> 💡 Note that the example uses `logging.AddXunitTestLogging`. This is available in the `Arcus.Testing.Logging.Xunit` package. See [this page on logging](../03-logging.mdx) for more information. - -## Message producer configuration - -The test message pump can be configured extensively to meet your needs. You can even pass in your own implementation of a test message producer to have full control over how the Azure Service Bus messages should look like. -When a custom message body is passed, an `ServiceBusReceivedMessage` will be created with the [correlation properties](https://messaging.arcus-azure.net/Features/message-handling/service-bus#message-correlation) already filled out. This allows for you to also test any the correlation specific functionality in your message handlers. - -```csharp -services.AddTestServiceBusMessagePump(producer => -{ - // Pass in a single custom message, which will become a `ServiceBusReceivedMessage`. - producer.AddMessageBody(order); - - // Pass in multiple custom messages, which will become `ServiceBusReceivedMessage` instances. - producer.AddMessageBodies(orders); - - // Pass in your own `ServiceBusReceivedMessage`. - // 💡 Use Microsoft's `ServiceBusModelFactory` to create such messages. - var message = ServiceBusModelFactory.ServiceBusReceivedMessage( - body: BinaryData.FromObjectAsJson(shipment), - messageId: Guid.NewGuid().ToString()); - producer.AddMessage(message); - - // Pass in your own `ServiceBusReceivedMessage` instances. - // 💡 Use Microsoft's `ServiceBusModelFactory` to create such messages. - var message = ServiceBusModelFactory.ServiceBusReceivedMessage( - body: BinaryData.FromObjectAsJson(shipment), - messageId: Guid.NewGuid().ToString()); - producer.AddMessages(new[] { message }); -}); -``` - -If the creation of Azure Service Bus messages is rather complex, you require asynchronous serialization, or you want to re-use your message producing; you can implement your own message producer. -This requires you to implement the `IAzureServiceBusMessageProducer` interface. - -```csharp -public class MyTestMessageProducer : IAzureServiceBusMessageProducer -{ - public async Task ProduceMessagesAsync() - { - var order = new Order(orderId: "123", scheduled: DateTimeOffset.UtcNow); - - var message = ServiceBusModelFactory.ServiceBusReceivedMessage( - body: BinaryData.FromObjectAsJson(shipment), - messageId: Guid.NewGuid().ToString(), - properties: new Dictionary - { - ["X-My-Custom-Key"] = "My-Custom-Value" - }); - - return Task.FromResult(new[] { message }); - } -} -``` - -Such implementation can be passed along during the registration: - -```csharp -var producer = new MyTestMessageProducer(); -services.AddTestServiceBusMessagePump(producer); -``` - -## Message routing configuration - -The test Azure Service Bus registration internally uses the Azure Service Bus message router. To configure this router, use one of the extension overloads. This gives you access to the message router options, like in a general Azure Service Bus message pump registration. - -```csharp -services.AddTestServiceBusMessagePump(..., options => -{ - options.Deserialization.AdditionalMembers = AdditionalMemberHandling.Error -}); -``` - -For more information on the message router options, see the [Arcus messaging feature documentation](https://messaging.arcus-azure.net/Features/message-handling/service-bus#pump-configuration). diff --git a/docs/preview/03-Features/07-Security/inmemory-secret-provider.md b/docs/preview/03-Features/07-Security/inmemory-secret-provider.md deleted file mode 100644 index 41f655c5..00000000 --- a/docs/preview/03-Features/07-Security/inmemory-secret-provider.md +++ /dev/null @@ -1,93 +0,0 @@ -# In-memory secret provider - -## Installation - -The following functionality is available when installing this package: - -```shell -PM> Install-Package -Name Arcus.Testing.Security.Providers.InMemory -``` - -## Usage - -As an addition to the [Arcus Security](https://github.com/arcus-azure/arcus.security) package, we have added an in-memory `ISecretProvider` implementation. -This secret provider is created so you can test you secret store configuration with non-secret values in a easy manner, without implementing your own `ISecretProvider`. - -⚡ Supports [synchronous secret retrieval](https://security.arcus-azure.net/Features/secrets/general). - -After installing the package, the `.AddInMemory` extension should be available to you: - -```csharp -using Microsoft.Extensions.Hosting; - -public void Program -{ - public static void Main(string[] args) - { - Host.CreateDefaultBuilder() - .ConfigureSecretStore((config, stores) => - { - // Adding a in-memory secret provider to the secret store, without any additional secrets. - // This is mainly used to have at least a single secret provider registration which is required for the secret store to be set up. - stores.AddInMemory(); - - // Adding a in-memory secret provider to the secret store, with a single secret name/value pair. - stores.AddInMemory("MySecret", "P@ssw0rd"); - - // Adding a in-memory secret provider to the secret store, with several secret name/value pairs. - stores.AddInMemory(new Dictionary - { - ["MySecret-1"] = "P@ssw0rd", - ["MySecret-2"] = "qwerty" - }); - }) - .Build() - .Run(); - } -} -``` - -The secret store will behave the same, so this in-memory secret provider will be a part when you inject the `ISecretProvider` in your application: - -```csharp -using Arcus.Security.Core; - -[ApiController] -public class MyController : ControllerBase -{ - public MyController(ISecretProvider secretProvider) - { - secretProvider.GetRawSecretAsync("MySecret"); - } -} -``` - -### Customization - -The in-memory secret provider also has some several extra options to customize the usage. - -```csharp -using Microsoft.Extenions.Hosting; - -public void Program -{ - public static void Main(string[] args) - { - Host.CreateDefaultBuilder() - .ConfigureSecretStore((config, stores) => - { - // Adding a in-memory secret provider to the secret store, with caching configuration. - // This means that the secret provider will be registered as a cached variant and can be retrieved as such (via `ISecretStore.GetCachedProvider`). - // For more information on caching secrets: https://security.arcus-azure.net/features/secrets/general - stores.AddInMemory("MySecret", "P@ssw0rd", new CacheConfiguration(TimeSpan.FromSeconds(5)); - - // Adding a in-memory secret provider to the secret store, with a dedicated name. - // This means that the secret provider can be retrieved with the `ISecretStore.GetProvider("your-name")`. - // For more information on retrieving a specific secret provider: https://security.arcus-azure.net/features/secret-store/named-secret-providers - stores.AddInMemory(new Dictionary { ["MySecret"] = "P@ssw0rd" }, secretProviderName: "InMemory"); - }) - .Build() - .Run(); - } -} -``` From aeee9712c7fa58b3bb2e3201c042604ebec117d9 Mon Sep 17 00:00:00 2001 From: stijnmoreels <9039753+stijnmoreels@users.noreply.github.com> Date: Tue, 31 Dec 2024 07:05:02 +0100 Subject: [PATCH 16/20] pr-fix: correct link in df --- .../04-Technology/06-Integration/01-data-factory.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/preview/03-Features/04-Technology/06-Integration/01-data-factory.mdx b/docs/preview/03-Features/04-Technology/06-Integration/01-data-factory.mdx index 2ee9997a..6d96cace 100644 --- a/docs/preview/03-Features/04-Technology/06-Integration/01-data-factory.mdx +++ b/docs/preview/03-Features/04-Technology/06-Integration/01-data-factory.mdx @@ -223,7 +223,7 @@ await session.RunDataFlowAsync(..., options => > 🚩 When the `RunDataFlow` method gives obscure Microsoft failures, it might be a problem with missing linked services that are being passed to the debug session. By default, all datasets are loaded automatically, but additional dependent linked services might not. ## Run a Data pipeline -Arcus does not provide any additional functionality to run a pipeline and wait for its result, as all this can be easily done with the [`Azure.ResourceManager.DataFactory`](https://learn.microsoft.com/en-us/dotnet/api/overview/azure/resourcemanager.datafactory-readme?view=azure-dotnet) and [`Arcus.Testing.Core`](../01-core.md) packages: +Arcus does not provide any additional functionality to run a pipeline and wait for its result, as all this can be easily done with the [`Azure.ResourceManager.DataFactory`](https://learn.microsoft.com/en-us/dotnet/api/overview/azure/resourcemanager.datafactory-readme?view=azure-dotnet) and [`Arcus.Testing.Core`](../../01-core.md) packages: ```csharp using Arcus.Testing; From c460dd4a98707c5381d3e8432af40471bd2a1a64 Mon Sep 17 00:00:00 2001 From: stijnmoreels <9039753+stijnmoreels@users.noreply.github.com> Date: Tue, 31 Dec 2024 07:08:24 +0100 Subject: [PATCH 17/20] pr-fix: use Azure as sub category --- docs/preview/02-getting-started.md | 6 +++--- .../04-Storage/01-storage-account.mdx | 0 .../04-Storage/02-cosmos.mdx | 0 .../06-Integration/01-data-factory.mdx | 0 ...te-from-testing-framework-to-arcus-testing-v1.0.mdx | 10 +++++----- 5 files changed, 8 insertions(+), 8 deletions(-) rename docs/preview/03-Features/{04-Technology => 04-Azure}/04-Storage/01-storage-account.mdx (100%) rename docs/preview/03-Features/{04-Technology => 04-Azure}/04-Storage/02-cosmos.mdx (100%) rename docs/preview/03-Features/{04-Technology => 04-Azure}/06-Integration/01-data-factory.mdx (100%) diff --git a/docs/preview/02-getting-started.md b/docs/preview/02-getting-started.md index 80d3c24c..4e043419 100644 --- a/docs/preview/02-getting-started.md +++ b/docs/preview/02-getting-started.md @@ -13,7 +13,7 @@ The libraries in the Arcus Testing space are split up in these main categories: - **Core infrastructure** (contains tech-independent functionality) - **Assertions** (contains ways to verify functionality) - **Logging** (contains ways to use Microsoft's `ILogger` in your test project) -- **Technology fixtures** (contains ways to interact with technology in your tests) +- **Azure fixtures** (contains ways to interact with technology in your tests) Depending on the context of your project, you might use one or more libraries in these categories. The following guides will show you how to start with these categories in new or existing projects. @@ -82,7 +82,7 @@ It also helps with passing arguments to implementation code that relies on `ILog In the same fashion, Arcus Testing has packages for all sorts of Azure technologies, each time with the test-usability in mind. > 🔗 See the following dedicated feature documentation pages for more information on interacting with your technology in your test: - > * [Storage Account](./03-Features/04-Technology/04-Storage/01-storage-account.mdx) - > * [Data Factory](./03-Features/04-Technology/06-Integration/01-data-factory.mdx) + > * [Storage Account](./03-Features/04-Azure/04-Storage/01-storage-account.mdx) + > * [Data Factory](./03-Features/04-Azure/06-Integration/01-data-factory.mdx) > * See the sidebar for more technologies. \ No newline at end of file diff --git a/docs/preview/03-Features/04-Technology/04-Storage/01-storage-account.mdx b/docs/preview/03-Features/04-Azure/04-Storage/01-storage-account.mdx similarity index 100% rename from docs/preview/03-Features/04-Technology/04-Storage/01-storage-account.mdx rename to docs/preview/03-Features/04-Azure/04-Storage/01-storage-account.mdx diff --git a/docs/preview/03-Features/04-Technology/04-Storage/02-cosmos.mdx b/docs/preview/03-Features/04-Azure/04-Storage/02-cosmos.mdx similarity index 100% rename from docs/preview/03-Features/04-Technology/04-Storage/02-cosmos.mdx rename to docs/preview/03-Features/04-Azure/04-Storage/02-cosmos.mdx diff --git a/docs/preview/03-Features/04-Technology/06-Integration/01-data-factory.mdx b/docs/preview/03-Features/04-Azure/06-Integration/01-data-factory.mdx similarity index 100% rename from docs/preview/03-Features/04-Technology/06-Integration/01-data-factory.mdx rename to docs/preview/03-Features/04-Azure/06-Integration/01-data-factory.mdx diff --git a/docs/preview/04-Guidance/migrate-from-testing-framework-to-arcus-testing-v1.0.mdx b/docs/preview/04-Guidance/migrate-from-testing-framework-to-arcus-testing-v1.0.mdx index f25dd6c8..5fd07cdb 100644 --- a/docs/preview/04-Guidance/migrate-from-testing-framework-to-arcus-testing-v1.0.mdx +++ b/docs/preview/04-Guidance/migrate-from-testing-framework-to-arcus-testing-v1.0.mdx @@ -327,7 +327,7 @@ Starting DataFlow's in a debug session is now linked to the `TemporaryDataFlowDe ### Run a Data pipeline Arcus does not provide any additional functionality to run a pipeline and wait for its result, as all this can be easily done with the [`Azure.ResourceManager.DataFactory`](https://learn.microsoft.com/en-us/dotnet/api/overview/azure/resourcemanager.datafactory-readme?view=azure-dotnet) and [`Arcus.Testing.Core`](../03-Features/01-core.md) packages. -🔗 See the [feature documentation](../03-Features/04-Technology/06-Integration/01-data-factory.mdx) for more information on testing DataFactory functionality. +🔗 See the [feature documentation](../03-Features/04-Azure/06-Integration/01-data-factory.mdx) for more information on testing DataFactory functionality. ## Replace storage account interactions @@ -364,7 +364,7 @@ The testing framework separated storage operations, which are now collected in a + await client.GetBlobsAsync(BlobTraits.None, BlobStates.None, ""); ``` -🔗 See the [feature documentation](../03-Features/04-Technology/04-Storage/01-storage-account.mdx) for more information on interacting with Blob storage. +🔗 See the [feature documentation](../03-Features/04-Azure/04-Storage/01-storage-account.mdx) for more information on interacting with Blob storage. ### Interact with Blob file The testing framework separated storage operations, which are now collected in a single `TemporaryBlobFile` test fixture. Based on the needs of the test, the fixture can be adapted. Interacting with the file can be done with the Azure SDK. @@ -387,7 +387,7 @@ The testing framework separated storage operations, which are now collected in a + BlobClient = file.Client; ``` -🔗 See the [feature documentation](../03-Features/04-Technology/04-Storage/01-storage-account.mdx) for more information on interacting with Blob storage. +🔗 See the [feature documentation](../03-Features/04-Azure/04-Storage/01-storage-account.mdx) for more information on interacting with Blob storage. @@ -427,7 +427,7 @@ The testing framework separated storage operations, which are now collected in a + await table.AddEntityAsync(); ``` -🔗 See the [feature documentation](../03-Features/04-Technology/04-Storage/01-storage-account.mdx) for more information on interacting with Table storage. +🔗 See the [feature documentation](../03-Features/04-Azure/04-Storage/01-storage-account.mdx) for more information on interacting with Table storage. @@ -472,4 +472,4 @@ The testing framework separated storage operations, which are now collected in a + await container.AddItemAsync(); ``` -🔗 See the [feature documentation](../03-Features/04-Technology/04-Storage/02-cosmos.mdx) for more information on interacting with Cosmos NoSql storage. \ No newline at end of file +🔗 See the [feature documentation](../03-Features/04-Azure/04-Storage/02-cosmos.mdx) for more information on interacting with Cosmos NoSql storage. \ No newline at end of file From b474617dd486ce1c59364ec5ddafa064ad5e2cfe Mon Sep 17 00:00:00 2001 From: stijnmoreels <9039753+stijnmoreels@users.noreply.github.com> Date: Tue, 31 Dec 2024 07:14:28 +0100 Subject: [PATCH 18/20] pr-fix: syntx error --- docs/preview/02-getting-started.md | 2 +- docs/preview/03-Features/03-logging.mdx | 22 ------------------- ...esting-framework-to-arcus-testing-v1.0.mdx | 2 +- 3 files changed, 2 insertions(+), 24 deletions(-) diff --git a/docs/preview/02-getting-started.md b/docs/preview/02-getting-started.md index 4e043419..15d81b47 100644 --- a/docs/preview/02-getting-started.md +++ b/docs/preview/02-getting-started.md @@ -32,7 +32,7 @@ The following guides will show you how to start with these categories in new or 1. Install the `Arcus.Testing.Core` NuGet package; 2. Locate the place where your tests retrieve their values; 3. Use the `var config = TestConfig.Create()` to create a default instance; - 4. Use the common `config["Your:Config:Key]` syntax to retrieve your value. + 4. Use the common `config["Your:Config:Key"]` syntax to retrieve your value. > 🔗 See [the dedicated feature documentation](./03-Features/01-core.md) for more information on this `Arcus.Testing.Core` package and what other common test operations you repeatably use, like polling, reading local files, etc. diff --git a/docs/preview/03-Features/03-logging.mdx b/docs/preview/03-Features/03-logging.mdx index ea7ebc6f..f50807ff 100644 --- a/docs/preview/03-Features/03-logging.mdx +++ b/docs/preview/03-Features/03-logging.mdx @@ -152,25 +152,3 @@ logger.LogInformation("This is an informational message"); IEnumerable messages = logger.Messages; ``` - -## Serilog in-memory log sink -The `Arcus.Testing.Logging.Core` library provides a `InMemoryLogSink` which is a [Serilog log sink](https://github.com/serilog/serilog/wiki/Configuration-Basics#sinks) -that collectes written log emits in-memory so the test infrastructure can assert on the actual rendered messages and possible properties available on the log emit. - -```csharp -using Arcus.Testing; -using Serilog; -using Serilog.Configuration; -using Serilog.Core; -using Serilog.Events; - -var logSink = new InMemoryLogSink(); -var logger = new LoggerConfiguration() - .WriteTo.Sink(logSink) - .CreateLogger(); - -logger.Information("This is an informational message"); - -IEnumerable emits = logSink.CurrentLogEmits; -IEnumeratble messages = logSink.CurrentLogMessages; -``` diff --git a/docs/preview/04-Guidance/migrate-from-testing-framework-to-arcus-testing-v1.0.mdx b/docs/preview/04-Guidance/migrate-from-testing-framework-to-arcus-testing-v1.0.mdx index 5fd07cdb..6f9f9da1 100644 --- a/docs/preview/04-Guidance/migrate-from-testing-framework-to-arcus-testing-v1.0.mdx +++ b/docs/preview/04-Guidance/migrate-from-testing-framework-to-arcus-testing-v1.0.mdx @@ -1,7 +1,7 @@ import Tabs from '@theme/Tabs'; import TabItem from '@theme/TabItem'; -# Migrate your test suite from Testing Framework to Arcus.Testing v1.0 +# Migrate your test suite from Testing Framework to Arcus.Testing v1 This guide will walk you through the process of migrating your test suite from using the Testing Framework to `Arcus.Testing`. > ⚠️ **IMPORTANT** to note that the `Arcus.Testing` approach uses the files in the build output in any of its functionality (`TestConfig`, `ResourceDirectory`...). It uses this approach for more easily access to the actual files used (instead of hidden as an embedded resource). It is best to add your files needed in your test project either as links ([see how](https://jeremybytes.blogspot.com/2019/07/linking-files-in-visual-studio.html)) or as actual files if only used for testing. **In both cases, they need to be copied to the output.**: From 9bb7ddec297c20f7d4ba43aa3742b5af153fc04c Mon Sep 17 00:00:00 2001 From: stijnmoreels <9039753+stijnmoreels@users.noreply.github.com> Date: Tue, 31 Dec 2024 07:18:31 +0100 Subject: [PATCH 19/20] pr-fix: ps io shell --- docs/docusaurus.config.js | 2 +- docs/preview/03-Features/01-core.md | 2 +- docs/preview/03-Features/02-assertion.mdx | 2 +- docs/preview/03-Features/03-logging.mdx | 6 +++--- .../04-Azure/04-Storage/01-storage-account.mdx | 4 ++-- .../03-Features/04-Azure/04-Storage/02-cosmos.mdx | 4 ++-- .../04-Azure/06-Integration/01-data-factory.mdx | 2 +- ...te-from-testing-framework-to-arcus-testing-v1.0.mdx | 10 +++++----- 8 files changed, 16 insertions(+), 16 deletions(-) diff --git a/docs/docusaurus.config.js b/docs/docusaurus.config.js index 1d518849..8799ee47 100644 --- a/docs/docusaurus.config.js +++ b/docs/docusaurus.config.js @@ -61,7 +61,7 @@ module.exports = { prism: { theme: lightCodeTheme, darkTheme: darkCodeTheme, - additionalLanguages: ['csharp', 'fsharp', 'diff'], + additionalLanguages: ['csharp', 'fsharp', 'diff', 'json', 'powershell'], }, }, presets: [ diff --git a/docs/preview/03-Features/01-core.md b/docs/preview/03-Features/01-core.md index fd245d47..916141e1 100644 --- a/docs/preview/03-Features/01-core.md +++ b/docs/preview/03-Features/01-core.md @@ -9,7 +9,7 @@ The features provided in this package are very often used and/or required for a ## Installation The following infrastructure is available when installing this package: -```shell +```powershell PM> Install-Package -Name Arcus.Testing.Core ``` diff --git a/docs/preview/03-Features/02-assertion.mdx b/docs/preview/03-Features/02-assertion.mdx index e45d45f7..4c2fdb7a 100644 --- a/docs/preview/03-Features/02-assertion.mdx +++ b/docs/preview/03-Features/02-assertion.mdx @@ -11,7 +11,7 @@ The `Arcus.Testing.Assert` library is a highly reusable and independent library ## Installation Install this package to easily assert on different output contents: -```shell +```powershell PM> Install-Package -Name Arcus.Testing.Assert ``` diff --git a/docs/preview/03-Features/03-logging.mdx b/docs/preview/03-Features/03-logging.mdx index f50807ff..6140cec7 100644 --- a/docs/preview/03-Features/03-logging.mdx +++ b/docs/preview/03-Features/03-logging.mdx @@ -17,7 +17,7 @@ This page describes functionality related to logging in tests. The following functionality is available when installing this package: - ```shell + ```powershell PM> Install-Package -Name Arcus.Testing.Logging.Xunit ``` @@ -53,7 +53,7 @@ This page describes functionality related to logging in tests. The following functionality is available when installing this package: - ```shell + ```powershell PM> Install-Package -Name Arcus.Testing.Logging.NUnit ``` @@ -89,7 +89,7 @@ This page describes functionality related to logging in tests. The following functionality is available when installing this package: - ```shell + ```powershell PM> Install-Package -Name Arcus.Testing.Logging.MSTest ``` diff --git a/docs/preview/03-Features/04-Azure/04-Storage/01-storage-account.mdx b/docs/preview/03-Features/04-Azure/04-Storage/01-storage-account.mdx index a2ffb6ea..6159f612 100644 --- a/docs/preview/03-Features/04-Azure/04-Storage/01-storage-account.mdx +++ b/docs/preview/03-Features/04-Azure/04-Storage/01-storage-account.mdx @@ -11,7 +11,7 @@ The `Arcus.Testing.Storage.Blob` package provides test fixtures related to Azure ## Installation The following functionality is available when installing this package: -```shell +```powershell PM> Install-Package -Name Arcus.Testing.Storage.Blob ``` @@ -169,7 +169,7 @@ The `Arcus.Testing.Storage.Table` package provides test fixtures related to Azur ## Installation The following functionality is available when installing this package: -```shell +```powershell PM> Install-Package -Name Arcus.Testing.Storage.Table ``` diff --git a/docs/preview/03-Features/04-Azure/04-Storage/02-cosmos.mdx b/docs/preview/03-Features/04-Azure/04-Storage/02-cosmos.mdx index 878b8274..b51a79b7 100644 --- a/docs/preview/03-Features/04-Azure/04-Storage/02-cosmos.mdx +++ b/docs/preview/03-Features/04-Azure/04-Storage/02-cosmos.mdx @@ -7,7 +7,7 @@ The `Arcus.Testing.Storage.CosmosDb` package provides test fixtures to Azure Cos ## Installation The following functionality is available when installing this package: -```shell +```powershell PM> Install-Package -Name Arcus.Testing.Storage.Cosmos ``` @@ -129,7 +129,7 @@ BsonValue documentId = document.Id; > 🛡️ Make sure that the test client that interacts with the Cosmos storage has at least [`Cosmos DB Built-in Data Contributor`](https://learn.microsoft.com/en-us/azure/cosmos-db/nosql/security/reference-data-plane-roles)-rights if the test needs to create/update/delete containers. > > **This role is not a built-in Azure RBAC, but a role specific for NoSql**. One can [assign this role with Azure CLI](https://learn.microsoft.com/en-us/cli/azure/cosmosdb/sql/role/assignment?view=azure-cli-latest#az-cosmosdb-sql-role-assignment-create): -> ```shell +> ```powershell > az cosmosdb sql role assignment create ` > --account-name "CosmosDBAccountName" ` > --resource-group "ResourceGroupName" ` diff --git a/docs/preview/03-Features/04-Azure/06-Integration/01-data-factory.mdx b/docs/preview/03-Features/04-Azure/06-Integration/01-data-factory.mdx index 6d96cace..437a3b14 100644 --- a/docs/preview/03-Features/04-Azure/06-Integration/01-data-factory.mdx +++ b/docs/preview/03-Features/04-Azure/06-Integration/01-data-factory.mdx @@ -7,7 +7,7 @@ The `Arcus.Testing.Integration.DataFactory` package provides test fixtures relat ## Installation The following functionality is available when installing this package: -```shell +```powershell PM> Install-Package -Name Arcus.Testing.Integration.DataFactory ``` diff --git a/docs/preview/04-Guidance/migrate-from-testing-framework-to-arcus-testing-v1.0.mdx b/docs/preview/04-Guidance/migrate-from-testing-framework-to-arcus-testing-v1.0.mdx index 6f9f9da1..74884ada 100644 --- a/docs/preview/04-Guidance/migrate-from-testing-framework-to-arcus-testing-v1.0.mdx +++ b/docs/preview/04-Guidance/migrate-from-testing-framework-to-arcus-testing-v1.0.mdx @@ -18,7 +18,7 @@ This guide will walk you through the process of migrating your test suite from u The `Codit.Testing.OutputComparison` library has some functionality to compare different kinds of file types. The new `Arcus.Testing.Assert` library handles these comparisons from now on. Start by installing this library: -```shell +```powershell PM > Install-Package -Name Arcus.Testing.Assert ``` @@ -257,7 +257,7 @@ The original Testing Framework had a `TestXsltSequential` exposed functionality The `Codit.Testing.DataFactory` handled start/stop functionality on DataFlow/Pipelines in DataFactory with and without debug sessions. Testing DataFlow's and managing debug sessions is now fully managed with `Arcus.Testing.Integration.DataFactory`. Start by installing this library: -```shell +```powershell PM > Install-Package -Name Arcus.Testing.Integration.DataFactory ``` @@ -340,7 +340,7 @@ The `Codit.Testing.BlobStorage` in the past acted as a wrapper for common storag These fixtures are configurable to fit the need of the test, instead of having to call multiple methods on 'helpers'. Start by installing this library: -```shell +```powershell PM > Install-Package -Name Arcus.Testing.Storage.Blob ``` @@ -398,7 +398,7 @@ The `Codit.Testing.TableStorage` in the past acted as a wrapper for common stora These fixtures are configurable to fit the need of the test, instead of having to call multiple methods on 'helpers'. Start by installing this library: -```shell +```powershell PM > Install-Package -Name Arcus.Testing.Storage.Table ``` @@ -438,7 +438,7 @@ The `Codit.Testing.CosmosDb` in the past acted as a wrapper for common storage o These fixtures are configurable to fit the need of the test, instead of having to call multiple methods on 'helpers'. Start by installing this library: -```shell +```powershell PM > Install-Package -Name Arcus.Testing.Storage.Cosmos ``` From 18e7777f6b8691a57e969e5abb76bcee2ebc35ef Mon Sep 17 00:00:00 2001 From: stijnmoreels <9039753+stijnmoreels@users.noreply.github.com> Date: Tue, 31 Dec 2024 07:32:41 +0100 Subject: [PATCH 20/20] pr-fix: typo in mongodb collection --- docs/preview/03-Features/04-Azure/04-Storage/02-cosmos.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/preview/03-Features/04-Azure/04-Storage/02-cosmos.mdx b/docs/preview/03-Features/04-Azure/04-Storage/02-cosmos.mdx index b51a79b7..89c30496 100644 --- a/docs/preview/03-Features/04-Azure/04-Storage/02-cosmos.mdx +++ b/docs/preview/03-Features/04-Azure/04-Storage/02-cosmos.mdx @@ -17,7 +17,7 @@ PM> Install-Package -Name Arcus.Testing.Storage.Cosmos > 🛡️ Make sure that the test client that interacts with the Cosmos storage has at least [`DocumentDB Account Contributor`](https://learn.microsoft.com/en-us/azure/role-based-access-control/built-in-roles/databases#documentdb-account-contributor)-rights if the test needs to create/update/delete collections. ### Temporary MongoDb collection -The `TemporaryMongoDbCollection` provides a solution when the integration tes requires a storage system (collection) during the test run. An MongoDb collection is created upon setup of the test fixture and is deleted again when the test fixture disposed. +The `TemporaryMongoDbCollection` provides a solution when the integration tes requires a storage system (collection) during the test run. A MongoDb collection is created upon setup of the test fixture and is deleted again when the test fixture disposed. > ⚡ The test fixture automatically uses an existing collection - if exists, but does not remove it if it was not responsible for creating the collection.