public void TestSetSessionIdNone()
        {
            var log = new EventLog {
                Toffset = 430
            };
            var sessions = new Dictionary <long, Guid> {
                { 431, Guid.Empty }, { 632, Guid.Empty }, { 461, Guid.Empty }
            };
            var success = SessionTracker.SetExistingSessionId(log, sessions);

            Assert.IsFalse(success);
            Assert.IsFalse(log.Sid.HasValue);
        }
Пример #2
0
        public void TestSetSessionIdNone()
        {
            var time = new DateTime(430 * TimeSpan.TicksPerMillisecond);
            var log  = new EventLog {
                Timestamp = time
            };
            var sessions = new Dictionary <long, Guid> {
                { 431, Guid.Empty }, { 632, Guid.Empty }, { 461, Guid.Empty }
            };
            var success = SessionTracker.SetExistingSessionId(log, sessions);

            Assert.IsFalse(success);
            Assert.IsFalse(log.Sid.HasValue);
        }
        public void TestSetSessionIdEqualTo()
        {
            var log = new EventLog {
                Toffset = 430
            };
            var intendedSid = Guid.NewGuid();
            var sessions    = new Dictionary <long, Guid> {
                { 4, Guid.Empty }, { 430, intendedSid }, { 431, Guid.Empty }
            };
            var success = SessionTracker.SetExistingSessionId(log, sessions);

            Assert.IsTrue(success);
            Assert.AreEqual(intendedSid, log.Sid.Value);
        }
Пример #4
0
        public void TestSetSessionIdEqualTo()
        {
            var time = new DateTime(430 * TimeSpan.TicksPerMillisecond);
            var log  = new EventLog {
                Timestamp = time
            };
            var intendedSid = Guid.NewGuid();
            var sessions    = new Dictionary <long, Guid> {
                { 4, Guid.Empty }, { 430, intendedSid }, { 431, Guid.Empty }
            };
            var success = SessionTracker.SetExistingSessionId(log, sessions);

            Assert.IsTrue(success);
            Assert.AreEqual(intendedSid, log.Sid);
        }