-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathInstanceTests.cs
50 lines (41 loc) · 1.36 KB
/
InstanceTests.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
using Solid.AspNetCore.Extensions.Wcf.Tests.Abstractions;
using Solid.Testing;
using System;
using System.ServiceModel;
using Xunit;
namespace Solid.AspNetCore.Extensions.Wcf.Tests
{
public class InstanceTests : IClassFixture<InstanceTestFixture>
{
public InstanceTests(InstanceTestFixture fixture)
{
_fixture = fixture;
}
private InstanceTestFixture _fixture;
public TestingServer TestingServer => _fixture.TestingServer;
[Fact]
public void ShouldHostPerCallService()
{
var service = _fixture.GetPerCallService();
var first = service.Counter();
var second = service.Counter();
var firstId = service.InstanceId();
var secondId = service.InstanceId();
Assert.Equal(1, first);
Assert.Equal(first, second);
Assert.NotEqual(firstId, secondId);
}
[Fact]
public void ShouldHostSingletonService()
{
var service = _fixture.GetSingletonService();
var first = service.Counter();
var second = service.Counter();
var firstId = service.InstanceId();
var secondId = service.InstanceId();
Assert.Equal(1, first);
Assert.Equal(2, second);
Assert.Equal(firstId, secondId);
}
}
}