public void plain_message_properties_test() { var parentObject = new TcoObject(new MockRootObject(), "parentObjectMessageTail", "parentObjectMessageSymbolTail"); var message = parentObject._messenger._mime; var plainTcoMessage = message.PlainMessage; Assert.AreEqual("parentObjectMessageTail", plainTcoMessage.Location); Assert.AreEqual("parentObjectMessageTail", plainTcoMessage.ParentsHumanReadable); Assert.AreEqual("parentObjectMessageSymbolTail", plainTcoMessage.ParentsObjectSymbol); Assert.AreEqual(0, plainTcoMessage.SubCategory); Assert.AreEqual("parentObjectMessageSymbolTail", plainTcoMessage.Source); }
public void GetActiveMessagesTest() { var context = new TcoContext(new MockRootObject(), string.Empty, string.Empty); var tcoObjectGreatParent = new TcoObject(context, string.Empty, string.Empty); var tcoObjectParent = new TcoObject(tcoObjectGreatParent, string.Empty, string.Empty); var tcoObject = new TcoObject(tcoObjectParent, string.Empty, string.Empty); context._startCycleCount.SetLastValue = 1875; var activeMessage = new TcoMessage(tcoObject, string.Empty, string.Empty); activeMessage.Cycle.SetLastValue = 1875; tcoObjectGreatParent.MessageHandler.DiagnosticsDepth = 1000; var actual = tcoObjectGreatParent.MessageHandler.GetActiveMessages(); Assert.AreEqual(1, actual.Count()); }
public void MessageDisplayTest() { var context = new TcoContext(new MockRootObject(), "context", "context"); var objL1 = new TcoObject(context, "objL1", "objL1"); var objL2 = new TcoObject(objL1, "objL2", "objL2"); context.MessageHandler.DiagnosticsDepth = 1000; objL1.MessageHandler.DiagnosticsDepth = 1000; objL2.MessageHandler.DiagnosticsDepth = 1000; context._startCycleCount.Cyclic = 1458; objL1._messenger._mime.Category.Cyclic = (short)eMessageCategory.Catastrophic; objL1._messenger._mime.Cycle.Cyclic = context._startCycleCount.LastValue; objL1._messenger._mime.Text.Cyclic = "hello from sequence"; objL2._messenger._mime.Category.Cyclic = (short)eMessageCategory.Catastrophic; objL2._messenger._mime.Cycle.Cyclic = context._startCycleCount.LastValue; objL2._messenger._mime.Text.Cyclic = "hello from mode controller"; context.Write(); var vm = new TcoDiagnosticsViewModel(context); vm.MinMessageCategoryFilter = eMessageCategory.Info; vm.UpdateMessages(); Assert.AreEqual(2, vm.MessageDisplay.Count()); var expected = new PlainTcoMessage(); objL1._messenger._mime.FlushOnlineToPlain(expected); expected.Source = objL1.Symbol; Assert.AreEqual(expected.ToString(), vm.MessageDisplay.ToList()[0].ToString()); expected = new PlainTcoMessage(); objL2._messenger._mime.FlushOnlineToPlain(expected); expected.Source = objL2.Symbol; Assert.AreEqual(expected.ToString(), vm.MessageDisplay.ToList()[1].ToString()); }
public void GetMessageHandlerTest() { var tcoObject = new TcoObject(new MockRootObject(), string.Empty, string.Empty); Assert.IsInstanceOf <TcoObjectMessageHandler>(tcoObject.MessageHandler); }
public void CtorTest() { var tcoObject = new TcoObject(new MockRootObject(), string.Empty, string.Empty); Assert.IsNotNull(tcoObject); }