Click or drag to resize

Neon.Xunit Namespace

This namespace includes unit test related helper classes include Xunit test fixtures for ASP.NET, Docker Containers, Docker Swarm, Environment variables, DNS (local hosts file), Kube services, NATS/STAN message queues.
Classes
  ClassDescription
Public classAnsiblePlayer
Used for running Ansible playbooks within unit tests.
Public classAnsiblePlayResults
Holds the results from an AnsiblePlayer play operation.
Public classAnsibleTaskResult
Holds the results for a specific task executed in an Ansible playbook.
Public classAspNetFixture
Fixture for testing ASP.NET Core based websites and services.
Public classCodeFixture
Used to execute some custom code while ComposedFixture is starting subfixtures. This is typically used to perform additional configuration of a ServiceMap, etc. to configure components like NeonService instances for integration testing.
Public classCollectionComparerT
Compares two collections for strict equality by ensuring they have the same items in the same order.
Public classComposedFixture
Implements an ITestFixture that is composed of other test fixtures.
Public classContainerFixture
Used to run a Docker container on the current machine as a test fixture while tests are being performed and then deletes the container when the fixture is disposed.
Public classContainerLimits

Used by same Docker related (and derived) fixtures to limit the machine resources that can be consumed by managed containers. We support many of the limits described in detail bere:

https://docs.docker.com/config/containers/resource_constraints/

Note Note
Byte size properties like Memory are strings including the size (a double) along with an optional unit designation from ByteUnits like KiB, MiB, and GiB rather than using the Docker unit conventions for consistency with neonKUBE cluster definitions, etc. These values will be converted to a simple byte count before passing them on to Docker.
Note Note
We're currently implementing some memory limits along with one CPU limit.
Public classDockerComposeFixture
Used to run a docker-compose application on the current machine as a test fixture while tests are being performed and then deletes the applicatiuon when the fixture is disposed.
Public classDockerFixture
An Xunit test fixture used to manage a local Docker daemon within unit tests.
Public classDockerFixtureConfigInfo
Holds information about a Docker config.
Public classDockerFixtureContainerInfo
Holds information about a Docker container.
Public classDockerFixtureNetworkInfo
Holds information about a Docker network.
Public classDockerFixtureSecretInfo
Holds information about a Docker secret.
Public classDockerFixtureServiceInfo
Holds information about a Docker service.
Public classDockerFixtureStackDefinition
Parses useful information from a Docker YAML compose file.
Public classDockerFixtureStackInfo
Holds information about a Docker stack.
Public classDockerFixtureStackService
Describes a Docker stack service.
Public classEnvironmentFixture
Used to manage environment variables and files for unit tests.
Public classHostsFixture
Used to manage the local DNS resolverhosts file on the current computer.
Public classIncompatibleServiceException
Public classMockHttpServer

Implements a very lightweight HTTP server suitable for locally mocking an HTTP based service.

Note Note
This currently runs only on Windows.
Public classMockHttpServerExtensions
Misc extsnsions.
Public classNatsFixture
Used to run a Docker nats container on the current machine as a test fixture while tests are being performed and then deletes the container when the fixture is disposed.
Public classNatsStreamingFixture
Used to run a Docker nats-streaming container on the current machine as a test fixture while tests are being performed and then deletes the container when the fixture is disposed.
Public classNeonServiceFixtureTService
Fixture for testing a NeonService.
Public classPlatformFactAttribute
Inherits from FactAttribute and sets Skip when the current operating system platform doesn't match any of the specified platform flags.
Public classRepeatAttribute
Used to annotate an Xunit [Theory] test method to have the test executed the specified number of times.
Public classSlowFactAttribute
Inherits from FactAttribute and sets Skip when the NEON_SKIPSLOWTESTS environment variable is set to "1".
Public classTestCategory
Defines constants used to help categorize unit tests and avoid spelling errors and inconsistencies.
Public classTestContext
Holds information like settings and test files for unit tests.
Public classTestFixture
Abstract test fixture base class.
Public classTestHelper
Misc local unit test helpers.
Public classTestHttpClient
Implements a HttpClient compatible client with additional capabilities, like disabling connection reuse. This is intended for unit testing purposes like verifying that load balancing actually works.
Public classTestOutputWriter

Wraps an ITestOutputHelper with a TextWriter that can be used generate output in unit tests that will be included in the captured test log.

Note Note
Only the WriteLine(...) methods are implemented.
Public classXunitExtensions
Unit test related extensions.
Interfaces
  InterfaceDescription
Public interfaceITestFixture

INTERNAL USE ONLY: Defines the behavior of a Neon Xunit test fixture.

Note Note
All test fixture implementations must inherit from TestFixture to work properly. Do not attempt to create a fixture from scratch that implements this interface.
Enumerations
  EnumerationDescription
Public enumerationTargetPlatforms
Enumerates the platforms that can be targeted by unit tests tagged with PlatformFactAttribute. Note that these flags may be bitwise-ORed together.
Public enumerationTestFixtureStatus
Returned by Start(Action) to indicate whether the test fixture was just started or was already running.