forked from roryprimrose/Neovolve.Streamline
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CustomServices.cs
51 lines (42 loc) · 1 KB
/
CustomServices.cs
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
43
44
45
46
47
48
49
50
51
namespace Examples
{
using System;
using FluentAssertions;
using NSubstitute;
using Xunit;
public interface ICustomService
{
string GetValue(Guid id);
}
public class CustomServices
{
private readonly ICustomService _service;
public CustomServices(ICustomService service)
{
_service = service;
}
public string GetValue(Guid id)
{
return _service.GetValue(id);
}
}
public class CustomServicesTests : Tests<CustomServices>
{
[Fact]
public void CanUseCustomService()
{
var id = Guid.NewGuid();
var wrapper = new Wrapper();
Use(wrapper);
var actual = SUT.GetValue(id);
actual.Should().Be(id.ToString());
}
private class Wrapper : ICustomService
{
public string GetValue(Guid id)
{
return id.ToString();
}
}
}
}