This repository has been archived on 2023-02-02. You can view files and clone it, but cannot push or open issues or pull requests.
mfgames-gallium-cil/tests/MfGames.Gallium.Tests/GalliumTestsBase.cs
D. Moonfire fb0a03e963
Some checks failed
ci/woodpecker/push/woodpecker Pipeline failed
ci/woodpecker/manual/woodpecker Pipeline was successful
feat(entity): added SetAll() which takes a params list
- added unit test to verify
- minor code clean up to get the tests running

closes #1
2023-01-14 17:13:01 -06:00

40 lines
991 B
C#

using Serilog;
using Serilog.Core;
using Xunit.Abstractions;
namespace MfGames.Gallium.Tests;
/// <summary>
/// Common initialization logic for Gallium-based tests including setting
/// up containers, logging, and Serilog.
/// </summary>
public abstract class GalliumTestsBase
{
protected GalliumTestsBase(ITestOutputHelper output)
{
this.Output = output;
// Set up logging.
const string Template =
"[{Level:u3}] "
+ "({SourceContext}) {Message}"
+ "{NewLine}{Exception}";
this.Logger = new LoggerConfiguration()
.WriteTo.TestOutput(
output,
outputTemplate: Template)
.CreateLogger();
}
/// <summary>
/// Gets the output for the tests.
/// </summary>
public ITestOutputHelper Output { get; }
/// <summary>
/// Gets the logger used to report messages about the test.
/// </summary>
protected Logger Logger { get; }
}