public void AddMessageTest() { var context = new TcoContext(new MockRootObject(), string.Empty, string.Empty); context.AddMessage(new TcoMessage(new MockRootObject(), string.Empty, string.Empty)); context.AddMessage(new TcoMessage(new MockRootObject(), string.Empty, string.Empty)); // Additional message on context may arise when the RtcIsNot synchronized. Assert.IsTrue(context.Messages.Count() == 4 || context.Messages.Count() == 3); }
public void ActiveMessagesTest() { var context = new TcoContext(new MockRootObject(), string.Empty, string.Empty); context._startCycleCount.SetLastValue = 1875; var activeMessage = new TcoMessage(context, string.Empty, string.Empty); activeMessage.Cycle.SetLastValue = 1875; context.AddMessage(activeMessage); context.AddMessage(new TcoMessage(context, string.Empty, string.Empty)); context.AddMessage(new TcoMessage(context, string.Empty, string.Empty)); var actual = context.MessageHandler.GetActiveMessages(); Assert.AreEqual(1, actual.Count()); }