Skip to content
This repository has been archived by the owner on Oct 2, 2024. It is now read-only.

Configuring systems to run unit tests on

Arne Halvorsen edited this page Jun 13, 2021 · 12 revisions

Work in progress

Realizing a system to run unit tests on by implementing ISystemConfiguration<World>

Realizing a system(s) to run unit tests on requires minimal two steps:

  1. Implementing at least one class with the interface ISystemConfiguration<World> where World is the world type.
  2. Decorate each ISystemConfiguration<World> implementation with at least one SysCon attribute: Each attribute realize a system using the implementation it decorate.

About implementing the ISystemConfiguration<World> interface

This interface declares three methods presented in the following:

IConfiguration GetConfiguration(SysCon meta);

All but the most simple systems need to read configuration data, this method provides it. It get passed the attribute object representing the system configured so can use the information given in the attribute for system to realize. This method is allowed to return null if no configuration data is required.

IServiceCollection ConfigureServices(IServiceCollection services, IConfiguration configuration, SysCon meta, string currentLayer);

This method adds the services required to realize the system. First parameter is collection to add services to and must be the method's return value. Second parameter is the configuration returned by the method GetConfiguration explained above. ... wip...

Task<bool> AvailableAsync();

About realizing system(s) to run unit tests on with the SysCon class attribute

About testing if a system available