Represents the NuGet versions.
- Enhancement: Added
WithGenericTester(MSTest and NUnit only) class to enable class-level generic tester usage versus one-off. - Enhancement: Added
TesterBase.UseScopedTypeSetUp()to enable a function that will be executed directly before eachScopedTypeTester{TService}is instantiated to allow standardized/common set up to occur.
- Enhancement: Extended the
MockHttpClientResponse.With*methods to support optional media type parameter to enable specification of theContent-Typeheader value. - Enhancement: Added
HttpResponseMessageAssertor.AssertContentTypeProblemJsonto enable asserting that the content type isapplication/problem+json. - Fixed:
HttpResponseMessageAssertor<TValue>.Valueno longer asserts the content type asapplication/jsonby default as this could not be overridden; this should be asserted explicitly usingAssertContentType(),AssertContentTypeJson(),AssertContentTypeProblemJson, etc.
- Enhancement: Added
.NET10.0support to allUnitTestExpackages. - Enhancement: Added
AssertNoNamedHeaderto theHttpResponseMessageAssertorto enable asserting that a named header is not present in the response.
- Fixed:
TestSetUpfixed to load all assemblies on start up (versus selective) to ensure allOneOffTestSetUpAttributeimplementations are executed prior to any test executions. - Fixed: Added
IJsonSerializer.Clone()andJsonElementComparerOptions.Cloneto ensure cross test contamination does not occur.
- Fixed: Republish packages with a new version; last publish was incomplete.
- Fixed: The
ValueExpectationscorrected to ensure that the expected value is correctly compared against the actual value.
- Enhancement: The
RunAsyncmethods updated to supportValueTaskas well asTaskfor theTypeTesterandGenericTester(.NET 9+ only). - Enhancement: Added
HttpResultAssertorfor ASP.NET Minimal APIsResults(e.g.Results.Ok(),Results.NotFound(), etc.) to enable assertions via theToHttpResponseMessageAssertor. - Enhancement:
TesterBase<TSelf>updated to support keyed services. - Enhancement
ScopedTypeTestercreated to support pre-instantiated scoped service where multiple tests can be run against the same scoped instance. The existingTypeTesterwill continue to directly execute a one-off scoped instance. These now exist on theTesterBase<TSelf>enabling broader usage. - Enhancement: Added
TesterBase<TSelf>.Delaymethod to enable delays to be added in a test where needed. - Fixed: The
ExpectationsArrangerupdated toClearversusResetafter an assertion run to ensure no cross-test contamination.
- Enhancement: The
GenericTesterwhere using.NET8.0and above will leverage the newIHostApplicationBuilderversus existingIHostBuilder(see Microsoft documentation and recommendation). Additionally, if aTEntryPointis specified with a method signature ofpublic void ConfigureApplication(IHostApplicationBuilder builder)then this will be automatically invoked during host instantiation. This is a non-breaking change as largely internal.
- Fixed: Added
TestFrameworkImplementor.SetLocalCreateFactoryto XunitApiTestFixtureconstructor to ensure set correctly for theOnConfigurationmethod override.
- Fixed: Added
TesterBase.JsonMediaTypeNameswhich provides a list of valid JSON media types to be used to determine JSON-related payloads in tests. - Fixed: Added Xunit
ApiTestFixture.OnConfigurationto enable configuration to be perform prior to test execution.
- Fixed: The
XunitLocalTestImplementor.SetLocalImplementorhas been made public. - Fixed: Added
TesterBase.ReplaceTestFrameworkImplementorto enable dynamic replacement.
- Fixed: The
ValueAssertor.Resultis being obsoleted and replaced withValueAssertor.Valueto be more explicit. TheResultproperty will be removed in a future version. - Fixed: The
ValueAssertorJSON-based assertions updated to serialize theValueand compare; versus, serializing the JSON and then comparing. - Fixed: The
ObjectComparer.JsonAssertis being obsoleted and replaced withObjectComparer.AssertJsonto be more consistent. TheJsonAssertmethod will be removed in a future version.
- Fixed: The
HttpResponseMessageAssertorBase.AssertErrorshas been extended to check for bothIDictionary<string, string[]>(previous) andHttpValidationProblemDetails(new) HTTP response JSON content. - Fixed: The
HttpResponseMessageAssertorBase.AssertJsoncorrected to not validate the content type as this should be handled by theAssertContentTypemethod. TheAssertJsonmethod now only checks the content against the expected JSON value.
- Fixed: The
ToHttpResponseMessageAssertorsupports a newHttpRequestparameter to enable access to the originatingHttpContextsuch that itsHttpResponseis used; versus, creating new internally.
- Enhancement: All
CreateHttpRequestand related methods moved toTesterBaseto ensure availability for all derived testers. - Enhancement: Added
ToHttpResponseMessageAssertortoActionResultAssertorandValueAssertorthat converts anIActionResultto anHttpResponseMessageand returns anHttpResponseMessageAssertorfor further assertions. The underlyingHostmust be configured (DI) correctly for this to function; otherwise, an exception will be thrown. - Enhancement: Added
WithApiTesterbase class per test framework to provide a sharedApiTesterinstance per test class; versus instantiating per test method. Be aware that using may result in cross-test contamination.
- Enhancement: Added
MockHttpClientResponse.Headermethods to enable the specification of headers to be included in the mocked response.- The
MockHttpClient.WithRequestsFromResourceYAML/JSON updated to also support the specification of response headers.
- The
- Enhancement: Added
TesterBase<TSelf>.UseAdditionalConfigurationmethod to enable additional configuration to be specified that overrides theIHostBuilderas the host is being built. This leverages the underlyingIConfigurationBuilder.AddInMemoryCollectioncapability to add. This is intended to support additional configuration that is not part of the standardappsettings.jsonorappsettings.unittest.jsonconfiguration.
- Enhancement: Where an
HttpRequestis used for an Azure FunctionsHttpTriggerTesterthe passedHttpRequest.PathAndQueryis checked against that defined by the correspondingHttpTriggerAttribute.Routeand will result in an error where different. TheHttpTrigger.WithRouteChecKandWithNoRouteCheckmethods control the path and query checking as needed.
- Enhancement:
UnitTestExpackage updated to include only standard .NET core capabilities; new packages created to house specific as follows:UnitTestEx.Azure.Functionscreated to house Azure Functions specific capabilities;UnitTestEx.Azure.ServiceBuscreated to house Azure Service Bus specific capabilities;- This allows for more focused testing capabilities and provides a common pattern for ongoing extensibility; whilst also looking to limit cross package dependency challenges.
- Existing usage will require references to the new packages as required. There should be limited need to update existing tests to use beyond the requirement for the root
UnitTestExnamespace. The updated default withinUnitTestExis to expose the key capabilities from the root namespace. For example,using UnitTestEx.NUnit, should be replaced withusing UnitTestEx.
- Enhancement: Updated
UnitTestEx.Xunitto align withUnitTestEx.NUnitandUnitTestEx.MSTestfor consistency; the followingUnitTestBasemethods have been removed and should be replaced with:CreateMockHttpClientFactory()replaced withMockHttpClientFactory.Create();CreateGenericTester()replaced withGenericTester.Create();CreateApiTester<TStartup>()replaced withApiTester.Create<TStartup>();CreateFunctionTester<TStartup>()replaced withFunctionTester.Create<TStartup>().
- Fixed: Updated
System.Text.Jsonpackage depenedency to latest; resolve Microsoft Security Advisory CVE-2024-43485.
- Fixed: Updated all package depenedencies to latest.
- Enhancement: Added
ExpectJsonandExpectJsonFromResourcetoIValueExpectationsto enable value comparison against the specified (expected) JSON.
- Fixed: Added
TraceRequestComparisonssupport toMockHttpClientto enable tracing for all requests.
- Fixed: Added
StringSyntaxAttributesupport to improve intellisense for JSON and URI specification.
- Enhancement: A new
MockHttpClient.WithRequestsFromResourcemethod enables the specification of the Request/Response configuration from a YAML/JSON embedded resource. Themock.unittestex.jsonJSON schema defines content.
- Enhancement: Any configuration specified as part of registering the
HttpClientservices from a Dependency Injection (DI) perspective is ignored by default when creating anHttpClientusing theMockHttpClientFactory. This default behavior is intended to potentially minimize any side-effect behavior that may occur that is not intended for the unit testing. SeeREADMEfor more details on capabilities introduced; highlights are:- New
MockHttpClient.WithConfigurationsmethod indicates that theHttpMessageHandlerandHttpClientconfigurations are to be used. - New
MockHttpClient.WithoutMockingmethod indicates that the underlyingHttpClientis not to be mocked; i.e. will result in an actual/real HTTP request to the specified endpoint. This will allow the mixing of real and mocked HTTP requests within the same test.
- New
- Fixed: The
AssertLocationHeaderhas been corrected to also support the specification of theUrias a string. Additionally, contains support has been added withAssertLocationHeaderContains.
- Fixed: The
TypeTesterwas not correctly capturing and outputting any of the logging, and also (as a result) theExpectLogContainswas not functioning as expected.
- Enhancement: Removed the
FunctionsStartupconstraint forTEntryPointto enable more generic usage. - Enhancement: Enable
Microsoft.Azure.Functions.Worker.HttpTriggerAttribute(new isolated function support), in addition to existingMicrosoft.Azure.WebJobs.HttpTriggerAttribute(existing in-process function support), withinHttpTriggerTester. - Enhancement: Enable
Microsoft.Azure.Functions.Worker.ServiceBusTriggerAttribute(new isolated function support), in addition to existingMicrosoft.Azure.WebJobs.ServiceBusTriggerAttribute(existing in-process function support), withinServiceBusTriggerTester.- Additionally,
CreateServiceBusMessageActionsis being renamed toCreateWebJobsServiceBusMessageActions; a newCreateWorkerServiceBusMessageActionshas been introduced to support isolatedMicrosoft.Azure.Functions.Worker.ServiceBusTriggerAttributetesting.
- Additionally,
- Enhancement: Upgraded
NUnitdependency to4.0.1; all unit tests now leverage theNUnitconstraint model testing approach.- Note: Also, as a result it is recommended prior to upgrading to
v4.1.0, where usingNUnit, that all existing unit tests are updated to use the new constraint model testing approach; see migration guide for details.
- Note: Also, as a result it is recommended prior to upgrading to
- Fixed: The
FunctionTesterBasewas updated to correctly load the configuration in the order similar to that performed by the Azure Functions runtime fabric. - Fixed: Removed all dependencies to
Newtonsoft.Json; a developer will need to explicitly add this dependency andIJsonSerializerimplementation where applicable.
All internal dependecies to CoreEx have been removed. This is intended to further generalize the capabilities of UnitTestEx; but more importantly, break the circular dependency reference between the two repositories. New CoreEx.UnitTesting* packages have been created to extend the UnitTestEx capabilities for CoreEx.
- Enhancement: All typed value assertions have been named
AssertValuefor consistency; otherwise,AssertContentfor a simple string comparison. - Enhancement: All JSON-related assertions have been named
AssertJson*for consistency. - Enhancement: The
CreateServiceBusMessagemethods that accept a genericTvalue have been renamed toCreateServiceBusMessageFromValue. - Enhancement: The
Expectationscapabilities have been greatly improved to support new expectations to be added/extended. - Enhancement: A new
GenericTesterthat explicitly supports aTValuehas been added; use newGenericTester.CreateFor<TValue>to instantiate/use. - Enhancement: Removed
KellermanSoftware.CompareNetObjectsdependency; all comparisons use internalJsonElementComparerwhich has proper/improved support for fully qualified paths, including optional array indexers. The relatedJsonElementComparerOptionsprovides a means to control the comparison behaviour. - Enhancement: The
ObjectComparerhas been reinstated and now leverages theJsonElementComparerinternally. - Enhancement: Updated to only support
.NET6.0and above; added.NET8.0support.
The enhancements have been made in a manner to maximize backwards compatibility with previous versions of UnitTestEx where possible; however, some breaking changes were unfortunately unavoidable (and made to improve overall). There may be an opportunity for the consuming developer to add extension methods to support the previous naming conventions if desired; note that the next CoreEx version (v3.6.0) will implement extensions in new CoreEx.UnitTesting packages to support existing behaviors (where applicable).
- Enhancement: Updated all package depenedencies to latest.
- Enhancement: The
GenericTesterupdated to supportIHostStartupto enable shared host dependency injection configuration. - Enhancement: Added
IEventExpectations<TSelf>andILoggerExpectations<TSelf>support toGenericTesterandValidationTester. - Enhancement: Moved the
CreateServiceBusMessageand related methods fromFunctionTesterBaseup the inheritance hierarchy toTesterBase<TSelf>to enable broader usage. - Enhancement: Added
ExpectEventFromJsonResourceandExpectDestinationEventFromJsonResourceexpectations to simplify specification versus having to instantiateEventData. - Enhancement: The
JsonElementComparernow defaults to case-insensitive comparison. - Enhancement: All internal usage of the
ObjectComparerreplaced with usage of theJsonElementComparerto break external dependency. AllMembersToIgnorehave been replaced withPathsToIgnore(being the fully-qualified JSON path) as this is more explicit and less error prone. TheObjectComparerhas been flagged asObsoleteand will be removed in a later version.
- Enhancement: Updated
CoreExdependencies to3.0.0as breaking changes were introduced. There are no breaking changes withinUnitTestExas a result; primarily related to the keyCoreExdependency.- Given the
CoreExdependency, explicitly the creation of the newCoreEx.AspNetCore, thisUnitTextExversion is not backwards compatible with previous versions ofCoreEx(i.e.2.x.x).
- Given the
- Enhancement: Updated all package dependencies to latest.
- Fixed: Corrected the log output to ensure they appear in sequence logged.
- Fixed: The
ServiceBusMessageActionsAssertorlogging now logs regardless of whether it is the last parameter in the method being executed. - Fixed: The loading of the
appsettings.unittest.jsonhas been moved after theFunctionsStartup.ConfigureAppConfigurationto override correctly.
- Fixed: Extended the
FunctionTesterBaseto enableCreateServiceBusMessageActionsandCreateServiceBusSessionMessageActionssimilar toCreateServiceBusMessageto enable mocked, unit testable, assert enabled, actions.
- Fixed: The
MockHttpClientRequestrequest Uri validation fixed.
- Fixed: The
MockHttpClientRequestrequest validation predicate has been improved to handle URL encoding. - Enhancement: The
FunctionTesterBasehas been extended to support the creation of aServiceBusReceivedMessageusingCreateServiceBusMessage(EventData),CreateServiceBusMessage(ServiceBusMessage)andCreateServiceBusMessage(AmqpAnnotatedMessage). - Enhancement: Added
ExpectLogContainsexpectation to confirm that the log output contains the specified text. - Enhancement: Updated all package dependencies to latest.
- Enhancement: Added
.NET7.0support to allUnitTestExpackages.
- Fixed: The
EventExpectationsinternally assigned members to ignore updated to useClassName.MemberNamesyntax to explicitly ignore. - Fixed: Added
ExpectEventValueandExpectDestinationEventValueexpectations to simplify specification versus having to instantiateEventDatawith expectedValue. - Fixed: To remove any
EventData.Valueimplementation (Type) differences theEventDatais now serialized during runtime publish, then deserialized prior to expectation check within test.
- Issue 52:
UnitTestBase.TestServeris nowpublic(versus previousprotected). - Issue 51: Anonymous types create read-only properties; these were by default ignored when comparing. Read-only properties are now included by default within the
ObjectComparer; note that these defaults can be overridden where applicable.
- Fixed: Incorrect package deployment; corrected.
- Enhancement: Added
TestSetUp.RegisterAutoSetUpthat will automatically throw aTestSetUpExceptionwhere unsuccessful; otherwise, queues the successful output message. This is required as most testing frameworks do not allow for a log write during construction or fuxture set up. The underlying UnitTestEx test classes will automatically log write where entries are discovered in the queue. This will at least ensure one of the underlying tests will output the success output where applicable. Otherwise, to log write explicitly useTestSetUp.LogAutoSetUpOutputs.
- Enhancement: Updated
CoreExdependencies to2.0.0as breaking changes were introduced. There are no breaking changes withinUnitTestExas a result; primarily related to the keyCoreExdependency.
- Enhancement:
TestSetUpcloned (fromTestSetUp.Default) perTesterBaseinstance to allow specific test changes. - Enhancement:
EventExpectationsnow supportsHasEventswhich simply verifies that one or more events were sent (ignores contents). - Enhancement:
ValidationTesterextended to supportRunCodemethods that execute passed action/function then catch and validate any thrownValidationException. - Enhancement: Added user identifier (
object) support forUseUserandWithUserthat leverages theTestSetUp.UserNameConverter. - Enhancement: Underlying host created within the context of a
lockto ensure thread-safety. Protections now in place to prohibit further changes once host has been created (ResetHostadded to explicitly enable further changes if/when needed). - Enhancement
HttpTesterBasesupports multi-threaded logging leveraging the newunit-test-ex-request-idheader to coordinate between test and api.
- Enhancement: Moved
usernamefrom all constructors toUseUser(userName)method. Additional,WithUser(userName)added toApiTesterto override the user name for a specific test invocation. - Enhancement: All references to
Usernamerenamed toUserNamefor consistency with the .NET framework naming convention. - Enhancement: Added
UsingApiTesterto provide a sharedApiTesterinstance per test class; versus instantiating per test method. Be aware that using may result in cross-test contamination. - Enhancement: The
ILoggertest instances updated to useTestSharedStateas a means to pass between hosted process and test process. Be aware that when tests are executed asynchronously there is currently no guarantee that the logs will be attributed to the correct test. - Enhancement: Added
TestSetUp.Environmentto specify the .NET environment for the likes of configuration file loading; defaults toDevelopment. - Enhancement: The mocked
Response.RequestMessageproperty is now updated with the initiating request. - Enhancement: Support for mocked default (unnamed)
HttpClientadded viaMockHttpClientFactory.CreateDefaultClientmethod.
- Fixed: Renamed
Expectextensions methods to match convention consistently. - Enhancement: Added
SystemExtensionMethodsclass to enable the likes ofint.ToGuid()for setting test-orientedGuidvalues. - Fixed:
ApiTesterupdated such thatappsettings.unittest.jsonis optional. - Enhancement: Added
ValidationTesterto support testing of anIValidatordirectly. - Enhancement: Added
GenericTesterto support testing of any generic code directly. - Fixed: Handle
AggregateExceptionby using itsInnerExceptionas theException.
- Enhancement: Updated the
ControllerTesterremoving the HTTP request capabilies and moving into newHttpTester; this creates a more logical split as the latter needs no knowledge of theController. This new tester is available viaApiTester.Http().Run(...). - Enhancement: Added new
UnitTextEx.Expectationsnamespace; when added will enableExpect*andIgnore*pre-execution assertions, that are then executed postRun/RunAsync. Some testers now also support the specification of aTResponsegenericTypeto enable further response value-related expectations.
- Fixed: The mock verification was not correctly updating the counter where there was a timeout. This has been corrected.
- Enhancement: Update
CoreExdependencies to1.0.4. - Fixed: Updated the Mock verification code and customized implementation to improve checking and error message.
- Enhancement: Update
CoreExdependencies to1.0.3. - Enhancement: Improve precision of milliseconds logging.
- Fixed: Expression invocation was incorrectly being invoked twice (and within the same scope), one with an await and the other without, racing each other and referencing the same DI scoped instances.
- Fixed: Added extra validation to test methods that accept expressions to ensure only simple expressions (no method-chaining) are allowed. There are other non-expression methods that should be used to enable these more advanced scenarios. In doing so however, some validation and logging features may not work as well as the expression enabled functionalities.
- Fixed: Where using
MockHttpClientResponse.Delaythis was performing aThread.Sleepinternally which ignored the usage of theCancellationTokenpassed into theSendAsync. TheThread.Sleephas been replaced with aTask.Delaywhich is now passed theCancellationTokenfrom the caller. This has also been extended where usingWithSequence.
- Fixed: Prior change for
ApiTesterrelated toappsettings.unittest.jsonwas not loading early enough and therefore not available forstartupconfiguration activities. This has now been resolved by pre-reading and adding as in-process environment variables. - Enhancement: Added
TypeTestersupport toApiTester. - Enhancement:
TypeTesterupdated toRunsynchronous methods as well as asynchronous. - Issue 30: Added support to specify the default JSON serializer via
appsettings.unittest.json. The following JSON will set theCoreEx.Json.JsonSerializer.Defaultto useCoreEx.Newtonsoft.Json.JsonSerializerversus the defaultCoreEx.Text.Json.JsonSerializer:{ "DefaultJsonSerializer": "Newtonsoft.Json" }.
- Fixed:
ApiTesterwas not finding theappsettings.jsonfrom originating solution. Updated the content root explicitly with the current directory:UseSolutionRelativeContentRoot(Environment.CurrentDirectory). - Enhancement: Added support for finding
appsettings.unittest.jsonfile, always added last to override any other previous settings (including environment variables, etc.). - Fixed:
MockHttpClientRequestwas incorrectly comparing the URL with an unencoded version; will always compare the original URL which must match on encodings also.
- Enhancement: Added additional
FunctionTesterBase.CreateHttpRequestoverloads to specify theContent-Type; defaults toMediaTypeNames.Text.Plain. - Enhancement: Breaking change. Renamed
ControllerTester.RunWithRequesttoRunHttpRequestto be more aligned toFunctionTesterBase. Also updated to support same set of overloads for consistency. - Enhancement: Improved the test logging such that the pre-execution details, such as HTTP request content, is output prior to execution to aid debugging of any exceptions/failures.
- Enhancement: Added
ActionResultAssertor.GetValueandAssertJsonto be consistent withHttpResponseMessageAssertor. - Enhancement: Added
AssertLocationHeaderandAssertETagHeaderto bothHttpResponseMessageAssertorandActionResultAssertor(forValueContentResult). - Enhancement: Updated
JsonElementComparerto return/list the differences found. Also, supportsPathsToIgnorefunctionality. - Enhancement: Added
MockHttpClientRequest.TraceRequestComparisonsthat indicates whether the request content comparison differences should be trace logged to aid in debugging/troubleshooting.
- Enhancement: Added body value parameter to the
ControllerTesterto allow where not directly specified for the underlying run method. - Enhancement: Added
HttpRequestOptionsparameter to theControllerTesterto allow further control and configuration of theUrifor theRunmethods. - Enhancement: Added some additional HTTP status code assertors.
- Enhancement:
HttpResponseMessageAssertor.AssertJsonadded to support JSON comparisons where noTypeis known. - Enhancement:
HttpResponseMessageAssertor.GetValue<TCollResult, TColl, TItem>added to supportICollectionResultresponses.
- Issue 27: The
TypeTesterhas been updated to ensure the result is logged correctly regardless of underlyingType. - Issue 28: The
FunctionTesterhas been updated to be more resilient to the JSON withinlocal.settings.json; i.e. ignore comments and trailing commas. - Enhancement:
ApiTesterandFunctionTesterupdated to provide aGetLogger<TCategoryName>method to simplify access to a typed logger.
- Enhancement: Breaking change. Integrate
CoreExpackage which primarily bringsIJsonSerializerfunctionality to enable configuration of eitherCoreEx.Text.Json.JsonSerializer(default) orCoreEx.Newtonsoft.Json.JsonSerializer. TheMockHttpClientFactory,ApiTesterandFunctionTesterhave new methodUseJsonSerializerto individually update from the default. To change the default for all tests then setCoreEx.Json.JsonSerializer.Defaultto the desired serializer. - Enhancement: Improved the replacement of the
MockHttpClientFactorywith theApiTesterandFunctionTester. Existing codetest.ConfigureServices(sc => mcf.Replace(sc))can be replaced withtest.ReplaceHttpClientFactory(mcf). - Enhancement: Added
ReplaceSingleton,ReplaceScopedandReplaceTransientmethods directly toApiTesterandFunctionTester. For example, existing codetest.ConfigureServices(sc => sc.ReplaceTransient<XXX>())can be replaced withtest.ReplaceTransient<XXX>(). - Enhancement: Added addtional
CreateHttpRequestoverloads to support additional parametersHttpRequestOptions? requestOptions = null, params IHttpArg[] argsas enabled byCoreEx. These enable additional capabilities for theHttpRequestquery string and headers.
- Issue 24: Added additional
IServiceCollection.Replaceextension methods to supportReplaceXxx<T>()andReplaceXxx<T, T>()to match the standardAddXxxmethods.
- Issue 22:
TypeTester.RunandRunAsyncmethods updated to supportFuncversusExpression<Func>to simplify runtime usage.
- Issue 20: Enabled casting of a
ResultAssertorto anActionResultAssertorwhere the resultTypeisIActionResultvia theResultAssertor.ToActionResultAssertormethod. - Enhancement: Enabled casting of a
ResultAssertorto anHttpResponseMessageAssertorwhere the resultTypeisHttpResponseMessagevia theResultAssertor.HttpResponseMessageAssertormethod.
- Issue 18:
ActionResultAssertor.Assertwith object value was not performing correct comparison when result isContentResultand the underlyingContentTypewasJson. - Enhancement: Write the
Contentsto the test output where the result isContentResult.
- Issue 12:
ObjectComparer.Assertadded for each test framework that compares two objects and will fail, and report, where there is not a match. - Issue 14: Re-introduced
ServiceBusTriggerTesterwhich manages execution and automatically logs the value associated with the trigger. - Issue 14: The
ServiceBusTriggerTester.Emulate(ServiceBusEmulatorTester) manages the execution of theServiceBusTriggerAttribuefunction method by orchestrating Azure Service Bus integration in a similar manner as if the Azure function run-time proper had invoked. - PR 16: Support all media types in
MockHttpClientRequest. - Enhancement: All
Runmethods now support aRunAsyncwhere appropriate.
- Issue 10: Breaking change. Changed the
ActionResultAssertor.AssertAcceptedandActionResultAssertor.AssertCreatedto assert status only; the existing value check should be performed using theActionResultAssertor.Assert. Pattern now is to check status and value separately (no longer all inclusive). - Issue 10: Breaking change. Changed the
HttpResponseMessageAssertor.AssertAcceptedandHttpResponseMessageAssertor.AssertCreatedto assert status only; the existing value check should be performed using theActionResultAssertor.Assert. Pattern now is to check status and value separately (no longer all inclusive). - Issue 10: Breaking change. Changed
ActionResultAssertor.AssertBadRequestandHttpResponseMessageAssertor.AssertBadRequestto assert status only; added newAssertErrorsto each for error message asserting. - Issue 9: Add
Servicesproperty (IServicesCollection) to bothApiTesterBaseandFunctionTesterBase. This allows direct access to the underlyingServicesoutside of the more typicalRun.
- Issue 7: Added delay (sleep) option so response is not always immediate.
- Enhancement: Breaking change.
Functions.GenericTriggerTesterreplaced withHosting.TypeTesteras agnostic to any function trigger.Functions.TriggerTesterBasereplaced withHosting.HostTesterBasefor same agnostic reasoning.FunctionTestBase.GenericTriggermethod renamed toFunctionTestBase.Typeso as to not imply a trigger requirement (i.e. can be any Type+Method that needs testing).
- Issue 3: Added support for MOQ
Timesstruct to verify the number of times a request is made. - Issue 4: Added support for MOQ sequences; i.e. multiple different responses.
- Issue 5: Deleted
MockServiceBusas the mocking failed to work as intended. This has been replaced byFunctionTesterBasemethods ofCreateServiceBusMessage,CreateServiceBusMessageFromResourceandCreateServiceBusMessageFromJson.
- Fixed:
MockHttpClientFactory.CreateClientoverloads were ambiquous, this has been corrected. - Fixed: Resolved logging output challenges between the various test frameworks and
ApiTester(specifically) to achieve consistent output. - Enhancement: The logging output now includes scope details.
- Added: New
MockServiceBus.CreateReceivedMessagewhich will mock theServiceBusReceivedMessageand add the passed value as serialized JSON into theBody(BinaryData).
- Added: A new
GenericTestertriggerhas been enabled for non HTTP-triggered functions. - Added: Assert capabilities, where applicable, support runtime
Exceptioncapturing, and haveAssertSuccessandAssertExceptionaccordingly. There is a newVoidAsserterto ensure success or exception where a function isvoid.
- New: Initial publish to GitHub/NuGet.