Beispiel #1
0
        public void OptionNames()
        {
            var s     = new TimestampOptions();
            var names = s.GetOptionNames();

            Assert.AreEqual(propertyNames.Count, names.Count);
        }
Beispiel #2
0
        public void TimeoutCustom()
        {
            var propertyIndex = 1;
            var expectedValue = 5000;

            var src = new TimestampOptions {
                Timeout = expectedValue
            };
            var so = PopulateOptions(src);

            AssertPopulatedProperty(so, propertyIndex, expectedValue);
        }
Beispiel #3
0
        public void GroupCustom()
        {
            var propertyIndex = 0;
            var expectedValue = false;

            var src = new TimestampOptions {
                Group = expectedValue
            };
            var so = PopulateOptions(src);

            AssertPopulatedProperty(so, propertyIndex, expectedValue);
        }
Beispiel #4
0
        public void FormatCustom()
        {
            var propertyIndex = 4;
            var expectedValue = TimestampFormatSetting.absolute;

            var src = new TimestampOptions {
                Format = expectedValue
            };
            var so = PopulateOptions(src);

            AssertPopulatedProperty(so, propertyIndex, expectedValue);
        }
Beispiel #5
0
        public void ColorCustom()
        {
            var propertyIndex = 3;
            var expectedValue = CreateColor();

            var src = new TimestampOptions {
                Color = expectedValue
            };
            var so = PopulateOptions(src);

            AssertPopulatedProperty(so, propertyIndex, expectedValue);
        }
    private void List_RetrieveVirtualItem(object?sender, RetrieveVirtualItemEventArgs e)
    {
        string[] LineInfo;
        int      index = ReversableIndex(e.ItemIndex, true);

        //this only makes senes knowing that it is really an IList
        // for a pure IEnumerable this will kill performance
        var Line = CurrentLines.Entries.ElementAt(index);

        LineInfo = new string[] { TimestampOptions.ConvertToString(Line.Timestamp), Line.Level, Line.Message };

        e.Item = new ListViewItem(LineInfo);
    }
Beispiel #7
0
        public void EmptyContructor()
        {
            var src = new TimestampOptions
            {
            };

            var so = PopulateOptions(src);

            Assert.AreEqual(0, so.Count);

            so = PopulateOptions(src, true);
            Assert.AreEqual(5, so.Count);
        }
Beispiel #8
0
        public void TimeoutDefault()
        {
            var propertyIndex = 1;
            var expectedValue = TimestampOptions.Defaults.Timeout;
            var src           = new TimestampOptions {
            };

            var so = PopulateOptions(src);

            AssertEmptyProperty(so, propertyIndex);

            so = PopulateOptions(src, true);
            AssertPopulatedProperty(so, propertyIndex, expectedValue);
        }
 public string[] AsArray(bool datesBeforeValue)
 {
     if (datesBeforeValue)
     {
         return(new string[] {
             Count.ToString(),
             TimestampOptions.ConvertToString(First),
             TimestampOptions.ConvertToString(Last),
             TraitValue
         });
     }
     else
     {
         return(new string[] {
             Count.ToString(),
             TraitValue,
             TimestampOptions.ConvertToString(First),
             TimestampOptions.ConvertToString(Last),
         });
     }
 }