forked from connamara/quickfixn
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathThreadedSocketAcceptorTests.cs
More file actions
61 lines (55 loc) · 1.35 KB
/
Copy pathThreadedSocketAcceptorTests.cs
File metadata and controls
61 lines (55 loc) · 1.35 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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using NUnit.Framework;
using QuickFix;
namespace UnitTests
{
[TestFixture]
public class ThreadedSocketAcceptorTests
{
private const string Config = @"
[DEFAULT]
StartTime = 00:00:00
EndTime = 23:59:59
ConnectionType = acceptor
SocketAcceptHost = 127.0.0.1
SocketAcceptPort = 10000
FileStorePath = store
FileLogPath = log
UseDataDictionary = N
[SESSION]
SenderCompID = sender
TargetCompID = target
BeginString = FIX.4.4
";
private static SessionSettings CreateSettings()
{
return new SessionSettings(new StringReader(Config));
}
private static ThreadedSocketAcceptor CreateAcceptor()
{
var settings = CreateSettings();
return new ThreadedSocketAcceptor(
new NullApplication(),
new FileStoreFactory(settings),
settings,
new FileLogFactory(settings));
}
[Test]
public void TestRecreation()
{
StartStopAcceptor();
StartStopAcceptor();
StartStopAcceptor();
}
private static void StartStopAcceptor()
{
var acceptor = CreateAcceptor();
acceptor.Start();
acceptor.Dispose();
}
}
}