diff --git a/QuickFIXn/Session.cs b/QuickFIXn/Session.cs
index 128dae377..6ac8a2061 100755
--- a/QuickFIXn/Session.cs
+++ b/QuickFIXn/Session.cs
@@ -463,7 +463,7 @@ public void Next()
if (!IsSessionTime)
{
- if(IsInitiator)
+ if (IsInitiator)
Reset("Out of SessionTime (Session.Next())");
else
Reset("Out of SessionTime (Session.Next())", "Message received outside of session time");
@@ -830,7 +830,7 @@ protected void NextResendRequest(Message resendReq)
{
initializeResendFields(msg);
- if(!ResendApproved(msg, SessionID))
+ if (!ResendApproved(msg, SessionID))
{
continue;
}
@@ -926,7 +926,7 @@ protected void NextSequenceReset(Message sequenceReset)
if (sequenceReset.IsSetField(Fields.Tags.GapFillFlag))
isGapFill = sequenceReset.GetBoolean(Fields.Tags.GapFillFlag);
- if (!Verify(sequenceReset, isGapFill, isGapFill))
+ if (!Verify(sequenceReset, !isGapFill, !isGapFill))
return;
if (sequenceReset.IsSetField(Fields.Tags.NewSeqNo))
@@ -1058,7 +1058,7 @@ public void Reset(string loggedReason)
/// message to put in the Logout message's Text field (ignored if null/empty string)
public void Reset(string loggedReason, string logoutMessage)
{
- if(this.IsLoggedOn)
+ if (this.IsLoggedOn)
GenerateLogout(logoutMessage);
Disconnect("Resetting...");
state_.Reset(loggedReason);
@@ -1150,7 +1150,7 @@ protected void DoPossDup(Message msg)
{
// If config RequiresOrigSendingTime=N, then tolerate SequenceReset messages that lack OrigSendingTime (issue #102).
// (This field doesn't really make sense in this message, so some parties omit it, even though spec requires it.)
- string msgType = msg.Header.GetString(Fields.Tags.MsgType);
+ string msgType = msg.Header.GetString(Fields.Tags.MsgType);
if (msgType == Fields.MsgType.SEQUENCE_RESET && RequiresOrigSendingTime == false)
return;
@@ -1388,7 +1388,7 @@ internal bool GenerateReject(MessageBuilder msgBuilder, FixValues.SessionRejectR
{
return GenerateReject(msgBuilder.RejectableMessage(), reason, 0);
}
-
+
internal bool GenerateReject(MessageBuilder msgBuilder, FixValues.SessionRejectReason reason, int field)
{
return GenerateReject(msgBuilder.RejectableMessage(), reason, field);
@@ -1533,7 +1533,7 @@ protected void InsertSendingTime(FieldMap header)
else
fix42OrAbove = this.SessionID.BeginString.CompareTo(FixValues.BeginString.FIX42) >= 0;
- header.SetField(new Fields.SendingTime(System.DateTime.UtcNow, fix42OrAbove ? TimeStampPrecision : TimeStampPrecision.Second ) );
+ header.SetField(new Fields.SendingTime(System.DateTime.UtcNow, fix42OrAbove ? TimeStampPrecision : TimeStampPrecision.Second));
}
protected void Persist(Message message, string messageString)
@@ -1595,7 +1595,7 @@ protected void InsertOrigSendingTime(FieldMap header, System.DateTime sendingTim
else
fix42OrAbove = this.SessionID.BeginString.CompareTo(FixValues.BeginString.FIX42) >= 0;
- header.SetField(new OrigSendingTime(sendingTime, fix42OrAbove ? TimeStampPrecision : TimeStampPrecision.Second ) );
+ header.SetField(new OrigSendingTime(sendingTime, fix42OrAbove ? TimeStampPrecision : TimeStampPrecision.Second));
}
protected void NextQueued()
{
diff --git a/UnitTests/SessionTest.cs b/UnitTests/SessionTest.cs
index ccfa316f4..b9ff7d3f4 100755
--- a/UnitTests/SessionTest.cs
+++ b/UnitTests/SessionTest.cs
@@ -12,7 +12,7 @@ class MockResponder : QuickFix.IResponder
#region Responder Members
QuickFix.DefaultMessageFactory messageFactory = new QuickFix.DefaultMessageFactory();
-
+
public Dictionary> msgLookup = new Dictionary>();
public Queue dups = new Queue();
@@ -38,7 +38,7 @@ public bool Send(string msgStr)
if (message.Header.IsSetField(possDup))
message.Header.GetField(possDup);
- if (possDup.getValue() && msgType.getValue()!= QuickFix.Fields.MsgType.SEQUENCE_RESET)
+ if (possDup.getValue() && msgType.getValue() != QuickFix.Fields.MsgType.SEQUENCE_RESET)
{
dups.Enqueue(message);
}
@@ -97,7 +97,7 @@ public void ToApp(QuickFix.Message message, QuickFix.SessionID sessionId)
{
if (doNotSendException != null)
throw doNotSendException;
-
+
}
public void FromApp(QuickFix.Message message, QuickFix.SessionID sessionID)
@@ -198,7 +198,7 @@ public void Setup()
// acceptor
session = new QuickFix.Session(false, application, new QuickFix.MemoryStoreFactory(), sessionID,
- new QuickFix.DataDictionaryProvider(),new QuickFix.SessionSchedule(config), 0, logFactory, new QuickFix.DefaultMessageFactory(), "blah");
+ new QuickFix.DataDictionaryProvider(), new QuickFix.SessionSchedule(config), 0, logFactory, new QuickFix.DefaultMessageFactory(), "blah");
session.SetResponder(responder);
session.CheckLatency = false;
@@ -254,15 +254,15 @@ public bool RESENT()
public bool SENT_REJECT()
{
- return responder.msgLookup.ContainsKey(QuickFix.Fields.MsgType.REJECT) &&
- responder.msgLookup[QuickFix.Fields.MsgType.REJECT].Count>0;
+ return responder.msgLookup.ContainsKey(QuickFix.Fields.MsgType.REJECT) &&
+ responder.msgLookup[QuickFix.Fields.MsgType.REJECT].Count > 0;
}
- public bool SENT_HEART_BEAT()
- {
+ public bool SENT_HEART_BEAT()
+ {
return responder.msgLookup.ContainsKey(QuickFix.Fields.MsgType.HEARTBEAT) &&
responder.msgLookup[QuickFix.Fields.MsgType.HEARTBEAT].Count > 0;
- }
+ }
public bool SENT_BUSINESS_REJECT()
{
@@ -317,7 +317,7 @@ public bool SENT_REJECT(int reason, int refTag)
QuickFix.Fields.SessionRejectReason reasonField = new QuickFix.Fields.SessionRejectReason();
msg.GetField(reasonField);
- if(reasonField.getValue() != reason)
+ if (reasonField.getValue() != reason)
return false;
if (!msg.IsSetField(QuickFix.Fields.Tags.RefTagID))
@@ -373,7 +373,7 @@ private void SendTheMessage(QuickFix.Message msg)
[Test]
public void ConditionalTagMissingReject()
- {
+ {
application.fromAppException = new QuickFix.FieldNotFoundException(61);
Logon();
@@ -388,10 +388,10 @@ public void ConditionalTagMissingReject()
public void IncorrectTagValueReject()
{
application.fromAppException = new QuickFix.IncorrectTagValue(54);
-
+
Logon();
SendNOSMessage();
- Assert.That(SENT_REJECT(QuickFix.Fields.SessionRejectReason.VALUE_IS_INCORRECT,54));
+ Assert.That(SENT_REJECT(QuickFix.Fields.SessionRejectReason.VALUE_IS_INCORRECT, 54));
}
@@ -408,7 +408,7 @@ public void UnsupportedMessageReject()
[Test]
public void LogonReject()
{
- application.fromAdminException = new QuickFix.RejectLogon("Failed Logon");
+ application.fromAdminException = new QuickFix.RejectLogon("Failed Logon");
Logon();
Assert.That(SENT_LOGOUT());
@@ -505,7 +505,7 @@ public void TestGapFillOnResend()
public void TestResendSessionLevelReject()
{
Assert.False(session.ResendSessionLevelRejects); // check for correct default
- Logon();
+ Logon();
QuickFix.FIX42.Reject reject = new QuickFix.FIX42.Reject(
new QuickFix.Fields.RefSeqNum(10));
@@ -545,12 +545,12 @@ public void AssertMicrosecondsInTag(string msgType, int tag, bool shouldHaveMicr
public void TestMillisecondsInSendingTimeStamp()
{
// MS in timestamp should default to Y
- Assert.That(session.TimeStampPrecision == QuickFix.Fields.Converters.TimeStampPrecision.Millisecond );
+ Assert.That(session.TimeStampPrecision == QuickFix.Fields.Converters.TimeStampPrecision.Millisecond);
// Ms should show up
Logon();
AssertMsInTag(QuickFix.Fields.MsgType.LOGON, QuickFix.Fields.Tags.SendingTime, true);
-
+
// No ms
session.TimeStampPrecision = QuickFix.Fields.Converters.TimeStampPrecision.Second;
Logon();
@@ -585,7 +585,7 @@ public void TestMicrosecondsInSendingTimeStamp()
// Less than FIX42 - no microseconds in timestamp, even if you tell it to
sessionID = new QuickFix.SessionID(QuickFix.FixValues.BeginString.FIX40, "SENDER", "TARGET");
session.SessionID = sessionID;
- session.TimeStampPrecision = QuickFix.Fields.Converters.TimeStampPrecision.Microsecond;
+ session.TimeStampPrecision = QuickFix.Fields.Converters.TimeStampPrecision.Microsecond;
Logon40();
Assert.That(responder.msgLookup[QuickFix.Fields.MsgType.LOGON].Count == 3);
AssertMicrosecondsInTag(QuickFix.Fields.MsgType.LOGON, QuickFix.Fields.Tags.SendingTime, false);
@@ -595,11 +595,11 @@ public void TestMicrosecondsInSendingTimeStamp()
public void TestMillisecondsInOrigSendingTimeStamp()
{
// MS in timestamp should default
- Assert.That( session.TimeStampPrecision == QuickFix.Fields.Converters.TimeStampPrecision.Millisecond );
-
+ Assert.That(session.TimeStampPrecision == QuickFix.Fields.Converters.TimeStampPrecision.Millisecond);
+
// Logon first
Logon();
-
+
// Do a resend request
SendResendRequest(0, 2);
AssertMsInTag(QuickFix.Fields.MsgType.SEQUENCERESET, QuickFix.Fields.Tags.OrigSendingTime, true);
@@ -789,7 +789,7 @@ public void TestDoesSessionExist()
QuickFix.SessionID validSessionID = new QuickFix.SessionID("FIX.4.2", "SENDER", "TARGET");
Assert.That(QuickFix.Session.DoesSessionExist(invalidSessionID), Is.EqualTo(false));
- Assert.That(QuickFix.Session.DoesSessionExist(validSessionID), Is.EqualTo(true));
+ Assert.That(QuickFix.Session.DoesSessionExist(validSessionID), Is.EqualTo(true));
}
[Test]
@@ -845,7 +845,7 @@ public void TestRequiresOrigSendingTime_Y()
Logon();
QuickFix.FIX42.SequenceReset sr = new QuickFix.FIX42.SequenceReset(new QuickFix.Fields.NewSeqNo(5));
- sr.GapFillFlag = new QuickFix.Fields.GapFillFlag(true);
+ sr.GapFillFlag = new QuickFix.Fields.GapFillFlag(false);
sr.Header.SetField(new QuickFix.Fields.PossDupFlag(true));
sr.Header.SetField(new QuickFix.Fields.MsgSeqNum(seqNum--)); // so it triggers DoTargetTooLow code