Ejemplo n.º 1
0
        public void Equality_ReallyTheSame()
        {
            var a = new TestIDEEvent
            {
                Id             = "1",
                ActiveDocument = Names.Document("d d"),
                ActiveWindow   = Names.Window("w w"),
                // Duration is automatically set
                IDESessionUUID = "2",
                KaVEVersion    = "3",
                TriggeredAt    = DateTime.Today.AddDays(-1),
                TerminatedAt   = DateTime.Today,
                TriggeredBy    = EventTrigger.Click
            };
            var b = new TestIDEEvent
            {
                Id             = "1",
                ActiveDocument = Names.Document("d d"),
                ActiveWindow   = Names.Window("w w"),
                // Duration is automatically set
                IDESessionUUID = "2",
                KaVEVersion    = "3",
                TriggeredAt    = DateTime.Today.AddDays(-1),
                TerminatedAt   = DateTime.Today,
                TriggeredBy    = EventTrigger.Click
            };

            Assert.AreEqual(a, b);
            Assert.AreEqual(a.GetHashCode(), b.GetHashCode());
        }
Ejemplo n.º 2
0
        public void Equality_Default()
        {
            var a = new TestIDEEvent();
            var b = new TestIDEEvent();

            Assert.AreEqual(a, b);
            Assert.AreEqual(a.GetHashCode(), b.GetHashCode());
        }
Ejemplo n.º 3
0
        public void Equality_DifferentId()
        {
            var a = new TestIDEEvent
            {
                Id = "1"
            };
            var b = new TestIDEEvent();

            Assert.AreNotEqual(a, b);
            Assert.AreNotEqual(a.GetHashCode(), b.GetHashCode());
        }