From c302260bf56ced824bedeac3d275618c5510f068 Mon Sep 17 00:00:00 2001 From: Eric Sibly Date: Wed, 9 Oct 2024 20:18:18 -0700 Subject: [PATCH] Demo `additionalConfiguration` usage. --- tests/UnitTestEx.NUnit.Test/ServiceBusFunctionTest.cs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/tests/UnitTestEx.NUnit.Test/ServiceBusFunctionTest.cs b/tests/UnitTestEx.NUnit.Test/ServiceBusFunctionTest.cs index 056bb46..171a3bc 100644 --- a/tests/UnitTestEx.NUnit.Test/ServiceBusFunctionTest.cs +++ b/tests/UnitTestEx.NUnit.Test/ServiceBusFunctionTest.cs @@ -2,6 +2,7 @@ using Microsoft.Extensions.DependencyInjection; using NUnit.Framework; using System; +using System.Collections.Generic; using System.Net; using System.Net.Http; using System.Text.Json; @@ -141,5 +142,14 @@ public void Configuration() var cv = test.Configuration.GetValue("SpecialKey"); Assert.That(cv, Is.EqualTo("VerySpecialValue")); } + + [Test] + public void Configuration_Overrride() + { + // Demonstrates how to override the configuration settings for a test. + using var test = FunctionTester.Create(additionalConfiguration: new Dictionary(new KeyValuePair[] { new("SpecialKey", "NotSoSpecial") })); + var cv = test.Configuration.GetValue("SpecialKey"); + Assert.That(cv, Is.EqualTo("NotSoSpecial")); + } } } \ No newline at end of file