Namespace Neon.Xunit
Classes
AnsiblePlayResults
Holds the results from an AnsiblePlayer play operation.
AnsiblePlayer
Used for running Ansible playbooks within unit tests.
AnsibleTaskResult
Holds the results for a specific task executed in an Ansible playbook.
AspNetFixture
Fixture for testing ASP.NET Core based websites and services.
BasicFixture
Used by unit tests that need to know when a test run is started vs. another test execution within the same run.
CodeFixture
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.
CollectionComparer<T>
Compares two collections for strict equality by ensuring they have the same items in the same order.
ComposedFixture
Implements an ITestFixture that is composed of other test fixtures.
ContainerFixture
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.
ContainerLimits
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
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
We're currently implementing some memory limits along with one CPU limit.
DockerComposeFixture
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.
note
The DockerComposeFixture and DockerFixture fixtures are not compatible with each other. You may only use one of these at a time.
DockerFixture
An Xunit test fixture used to manage a local Docker daemon within unit tests.
note
The DockerComposeFixture and DockerFixture fixtures are not compatible with each other. You may only use one of these at a time.
DockerFixture.ConfigInfo
Holds information about a Docker config.
DockerFixture.ContainerInfo
Holds information about a Docker container.
DockerFixture.NetworkInfo
Holds information about a Docker network.
DockerFixture.SecretInfo
Holds information about a Docker secret.
DockerFixture.ServiceInfo
Holds information about a Docker service.
DockerFixture.StackDefinition
Parses useful information from a Docker YAML compose file.
DockerFixture.StackInfo
Holds information about a Docker stack.
DockerFixture.StackService
Describes a Docker stack service.
EnvironmentFixture
Used to save environment variables before unit tests run and then restore them afterwards.
HostsFixture
Used to manage the local DNS resolverhosts file on the current computer.
IncompatibleServiceException
Thrown by ValidateController<TServiceController>(IGeneratedServiceClient) when the service type doesn't match a generated service client.
MaintainerFactAttribute
Inherits from Xunit.FactAttribute and sets Xunit.FactAttribute.Skip when the current operating system platform doesn't match any of the specified platform flags.
MaintainerTheoryAttribute
Inherits from Xunit.TheoryAttribute and sets Xunit.FactAttribute.Skip when the current operating system platform doesn't match any of the specified platform flags.
MockHttpServer
Implements a very lightweight HTTP server suitable for locally mocking an HTTP based service.
note
This currently runs only on Windows.
MockHttpServerExtensions
Misc extsnsions.
NatsFixture
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.
NatsStreamingFixture
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.
NeonServiceFixture<TService>
Fixture for testing a NeonService.
PlatformFactAttribute
Inherits from Xunit.FactAttribute and sets Xunit.FactAttribute.Skip when the current operating system platform doesn't match any of the specified platform flags.
RepeatAttribute
Used to annotate an Xunit [Theory]
test method to have the test executed
the specified number of times.
TestArea
Defines the NEONFORGE related test areas. These currently map to
NEONFORGE related projects. Use these in [Trait(TestTrait.Category, ...)]
attributes tagging your test methods.
TestCollection
Enumerates the NEONSDK related xUnit test collections.
TestContext
Holds information like settings and test files for unit tests.
TestFixture
Abstract test fixture base class.
TestHelper
Misc local unit test helpers.
TestHttpClient
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.
TestOutputWriter
Wraps an Xunit.Abstractions.ITestOutputHelper with a TextWriter that can be used generate output in unit tests that will be included in the captured test log.
note
Only the Write(...)
and WriteLine(...)
methods are implemented.
TestTrait
Identifies the common NEONFORGE related test traits.
XunitExtensions
Unit test related extensions.
Interfaces
ITestFixture
INTERNAL USE ONLY: Defines the behavior of a Neon Xunit test fixture.
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.
Enums
TargetPlatforms
Enumerates the platforms that can be targeted by unit tests tagged with PlatformFactAttribute. Note that these flags may be bitwise-ORed together.
TestFixtureStatus
Returned by Start(Action) to indicate whether the test fixture is not running, was just started, or was already running.