Exemple #1
0
        public void Parsing_Roundtrip()
        {
            var actual   = new KaVEVersion("0.123-Development");
            var expected = new KaVEVersion(123, Variant.Development);

            Assert.AreEqual(expected, actual);
        }
Exemple #2
0
        public void Equality_DifferentVariant()
        {
            var a = new KaVEVersion(123, Variant.Development);
            var b = new KaVEVersion(123, Variant.Default);

            Assert.AreNotEqual(a, b);
            Assert.AreNotEqual(a.GetHashCode(), b.GetHashCode());
        }
Exemple #3
0
        public void Equality_ReallyTheSame()
        {
            var a = new KaVEVersion(123, Variant.Development);
            var b = new KaVEVersion(123, Variant.Development);

            Assert.AreEqual(a, b);
            Assert.AreEqual(a.GetHashCode(), b.GetHashCode());
        }
Exemple #4
0
        public void Init_WithString()
        {
            var sut = new KaVEVersion("0.123-Development");

            Assert.AreEqual(new Version(0, 123), sut.Version);
            Assert.AreEqual(Variant.Development, sut.Variant);
            Assert.AreEqual(123, sut.ReleaseNumber);
        }
Exemple #5
0
        public void Init_WithValues()
        {
            var sut = new KaVEVersion(123, Variant.Development);

            Assert.AreEqual(new Version(0, 123), sut.Version);
            Assert.AreEqual(Variant.Development, sut.Variant);
            Assert.AreEqual(123, sut.ReleaseNumber);
        }
 public override int GetHashCode()
 {
     unchecked
     {
         var hashCode = StartTime.GetHashCode();
         hashCode = (hashCode * 397) ^ Duration.GetHashCode();
         hashCode = (hashCode * 397) ^ UserId.GetHashCode();
         hashCode = (hashCode * 397) ^ IDESessionId.GetHashCode();
         hashCode = (hashCode * 397) ^ (KaVEVersion != null ? KaVEVersion.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ Project.GetHashCode();
         return(hashCode);
     }
 }
Exemple #7
0
 public override int GetHashCode()
 {
     unchecked
     {
         var hashCode = (Id != null ? Id.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (IDESessionUUID != null ? IDESessionUUID.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (KaVEVersion != null ? KaVEVersion.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ TriggeredAt.GetHashCode();
         hashCode = (hashCode * 397) ^ (int)TriggeredBy;
         hashCode = (hashCode * 397) ^ Duration.GetHashCode();
         hashCode = (hashCode * 397) ^ (ActiveWindow != null ? ActiveWindow.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (ActiveDocument != null ? ActiveDocument.GetHashCode() : 0);
         return(hashCode);
     }
 }
        public IEnumerable <Interval> TransformWithCustomTransformer(IEnumerable <IDEEvent> events,
                                                                     IEventToIntervalTransformer <Interval> transformer)
        {
            events = _fixer.FixAndFilter(events);

            _logger.Info(@"Transforming event stream with {0} ...", transformer.GetType().Name);

            var currentEventTime = DateTimeOffset.MinValue;
            var i = 0;

            foreach (var e in events)
            {
                i++;
                if (i % 500 == 0)
                {
                    Console.Write('.');
                }
                if (i % 50000 == 0)
                {
                    Console.WriteLine();
                }

                if (TransformerUtils.EventHasNoTimeData(e))
                {
                    continue;
                }

                var version = new KaVEVersion(e.KaVEVersion);
                if (version.ReleaseNumber < _firstVersionToInclude)
                {
                    continue;
                }

                Asserts.IsLessOrEqual(currentEventTime, e.TriggeredAt.GetValueOrDefault());

                currentEventTime = e.TriggeredAt.GetValueOrDefault();

                transformer.ProcessEvent(e);
            }
            Console.WriteLine();
            _logger.Info("--> Done processing {0} events...", i);

            return(transformer.SignalEndOfEventStream());
        }
Exemple #9
0
        public void ToStringIsImplemented()
        {
            var sut = new KaVEVersion(1234, Variant.Development);

            Assert.AreEqual("0.1234-Development", sut.ToString());
        }