forked from quickfix/quickfix
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSessionSettingsTestCase.rb
More file actions
41 lines (34 loc) · 950 Bytes
/
Copy pathSessionSettingsTestCase.rb
File metadata and controls
41 lines (34 loc) · 950 Bytes
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
require 'quickfix_ruby'
require 'test/unit'
class SessionSettingsTestCase < Test::Unit::TestCase
def setup
@object = Quickfix::SessionSettings.new()
end
def test_validate
sessionID = Quickfix::SessionID.new( "FIX.4.2", "SenderCompID", "TargetCompID" )
dictionary = Quickfix::Dictionary.new
begin
@object.set( sessionID, dictionary )
assert( false )
rescue Quickfix::ConfigError
end
dictionary.setString( Quickfix::CONNECTION_TYPE(), "badvalue" )
begin
@object.set( sessionID, dictionary );
assert( false );
rescue Quickfix::ConfigError
end
dictionary.setString( Quickfix::CONNECTION_TYPE(), "initiator" )
begin
@object.set( sessionID, dictionary );
rescue Quickfix::ConfigError
assert( false )
end
sessionID = Quickfix::SessionID.new( "FIX4.2", "SenderCompID", "TargetCompID" )
begin
@object.set( sessionID, dictionary )
assert( false )
rescue Quickfix::ConfigError
end
end
end