Skip to content

Commit

Permalink
verbatim string literals are easier to read
Browse files Browse the repository at this point in the history
  • Loading branch information
gbirchmeier committed Jun 12, 2015
1 parent 61b049b commit 747ef80
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 21 deletions.
14 changes: 6 additions & 8 deletions UnitTests/SessionSettingsTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -305,14 +305,12 @@ public void SettingsFileRelease()
[Test]
public void CaseInsensitiveSectionName()
{
string configuration = new System.Text.StringBuilder()
.AppendLine("[dEfAuLt]")
.AppendLine("ConnectionType=initiator")
.AppendLine("[sEsSiOn]")
.AppendLine("BeginString=FIX.4.2")
.AppendLine("SenderCompID=ISLD")
.AppendLine("TargetCompID=TW")
.ToString();
string configuration = @"[dEfAuLt]
ConnectionType=initiator
[sEsSiOn]
BeginString=FIX.4.2
SenderCompID=ISLD
TargetCompID=TW";
SessionSettings settings = new SessionSettings(new System.IO.StringReader(configuration));

Assert.That(settings.Get().GetString("ConnectionType"), Is.EqualTo("initiator"));
Expand Down
33 changes: 20 additions & 13 deletions UnitTests/SettingsTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,26 @@ public class SettingsTest
[Test]
public void Load()
{
string configuration = new System.Text.StringBuilder()
.AppendLine("[FOO]").AppendLine("bar=24").AppendLine("baz=moo")
.AppendLine("[OREN]").AppendLine("Nero=TW").AppendLine("#Nero=IGNOREME")
.AppendLine("# this is a comment")
.AppendLine("#[OREN]").AppendLine("#Nero=IGNOREME")
.AppendLine("[OREN]").AppendLine("ISLD=Nero").AppendLine("STUFF=./\\:")
.AppendLine("[NERO]").AppendLine("WINDIR=D:\\This Is\\A-Directory\\Connamara\\")
.AppendLine("WINFILE=D:\\Program Files\\Tomcat 4.1\\webapps\\mgatny\\WEB-INF\\connamara.cfg")
.AppendLine("UNIXDIR=/home/mgatny/This Is/A Directory/ok/")
.AppendLine("stripspace=last spaces stripped ")
.AppendLine("#Nero=IGNOREME")
.AppendLine("EqualsInValue=We can have '=' in the value")
.ToString();
string configuration = @"[FOO]
bar=24
baz=moo
[OREN]
Nero=TW
#Nero=IGNOREME
# this is a comment
#[OREN]
#Nero=IGNOREME
[OREN]
ISLD=Nero
STUFF=./\:
[NERO]
WINDIR=D:\This Is\A-Directory\Connamara\
WINFILE=D:\Program Files\Tomcat 4.1\webapps\mgatny\WEB-INF\connamara.cfg
UNIXDIR=/home/mgatny/This Is/A Directory/ok/
stripspace=last spaces stripped
#Nero=IGNOREME
EqualsInValue=We can have '=' in the value
";
Settings settings = new Settings(new System.IO.StringReader(configuration));

LinkedList<QuickFix.Dictionary> foo = settings.Get("FOO");
Expand Down

0 comments on commit 747ef80

Please sign in to comment.