forked from roryprimrose/Neovolve.Streamline
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTestClassConstructorParameters.cs
More file actions
42 lines (35 loc) · 1.01 KB
/
TestClassConstructorParameters.cs
File metadata and controls
42 lines (35 loc) · 1.01 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
namespace Examples
{
using System;
using Divergic.Logging.Xunit;
using FluentAssertions;
using Microsoft.Extensions.Logging;
using NSubstitute;
using Xunit;
using Xunit.Abstractions;
public class TestClassConstructorParameters
{
private readonly ILogger _logger;
public TestClassConstructorParameters(ILogger logger)
{
_logger = logger;
}
public void DoSomething()
{
_logger.LogInformation("Hey, we did something at {0}", DateTimeOffset.UtcNow);
}
}
public class TestClassConstructorParametersTests : Tests<TestClassConstructorParameters>
{
public TestClassConstructorParametersTests(ITestOutputHelper output) : base(output.BuildLogger())
{
}
[Fact]
public void CanUseTestConstructorArgument()
{
var logger = Service<ICacheLogger>();
SUT.DoSomething();
logger.Entries.Should().HaveCount(1);
}
}
}