Example #1
0
        public void CompareDict2()
        {
            TaskQueue.TQItemSelector sel = new TaskQueue.TQItemSelector("field1", TaskQueue.TQItemSelectorSet.Descending)
                                           .Rule("field2", TaskQueue.TQItemSelectorSet.Ascending);
            SomeExtMessage inst = new SomeExtMessage()
            {
                field1 = 5,
                field2 = 15
            };

            TaskQueue.Providers.TaskMessage.InternalComparableDictionary cmp = (TaskQueue.Providers.TaskMessage.InternalComparableDictionary)
                                                                               TaskQueue.Providers.TaskMessage.MakeComparatorDictionary(sel);
            SomeExtMessage inst_CE = new SomeExtMessage()
            {
                field1 = 6,
                field2 = 15
            };
            SomeExtMessage inst_CL = new SomeExtMessage()
            {
                field1 = 4,
                field2 = 18
            };

            TaskQueue.Providers.TaskMessage defmsg = new TaskQueue.Providers.TaskMessage("X");
            Assert.AreEqual(cmp(inst.GetHolder(), inst_CE.GetHolder()),
                            TaskQueue.Providers.TaskMessage.CompareWithSelector(inst.GetHolder(), inst_CE.GetHolder(), sel));

            Assert.AreEqual(cmp(inst.GetHolder(), inst_CL.GetHolder()),
                            TaskQueue.Providers.TaskMessage.CompareWithSelector(inst.GetHolder(), inst_CL.GetHolder(), sel));

            Assert.AreEqual(cmp(inst_CL.GetHolder(), inst_CE.GetHolder()),
                            TaskQueue.Providers.TaskMessage.CompareWithSelector(inst_CL.GetHolder(), inst_CE.GetHolder(), sel));

            Assert.AreEqual(cmp(defmsg.GetHolder(), inst_CE.GetHolder()),
                            TaskQueue.Providers.TaskMessage.CompareWithSelector(defmsg.GetHolder(), inst_CE.GetHolder(), sel));
        }
Example #2
0
 public MailModel(TaskQueue.Providers.TaskMessage holder)
     : base(holder.MType)
 {
     this.SetHolder(holder.GetHolder());
 }
Example #3
0
 public SomeExtMessage(TaskQueue.Providers.TaskMessage holder)
     : base(holder.MType)
 {
     this.SetHolder(holder.GetHolder());
 }