Exemple #1
0
        public void EqualityDefault()
        {
            var a = new InteractionStatistics();
            var b = new InteractionStatistics();

            Assert.AreEqual(a, b);
            Assert.AreEqual(a.GetHashCode(), b.GetHashCode());
        }
Exemple #2
0
        public void DefaultValues()
        {
            var sut = new InteractionStatistics();

            Assert.AreEqual(DateTimeOffset.MinValue, sut.DayFirst);
            Assert.AreEqual(DateTimeOffset.MinValue, sut.DayLast);
            Assert.AreEqual(0, sut.NumDays);
            Assert.AreEqual(0, sut.NumMonth);
            Assert.AreEqual(0, sut.NumEventsTotal);
            Assert.AreEqual(new Dictionary <Type, int>(), sut.NumEventsDetailed);
            Assert.AreEqual(Educations.Unknown, sut.Education);
            Assert.AreEqual(Positions.Unknown, sut.Position);
            Assert.AreEqual(0, sut.NumCodeCompletion);
            Assert.AreEqual(0, sut.NumTestRuns);
            Assert.AreEqual(TimeSpan.Zero, sut.ActiveTime);

            Assert.AreNotEqual(0, sut.GetHashCode());
            Assert.AreNotEqual(1, sut.GetHashCode());
        }
Exemple #3
0
        public void Different_ActiveTime()
        {
            var a = new InteractionStatistics();
            var b = new InteractionStatistics
            {
                ActiveTime = TimeSpan.FromSeconds(3)
            };

            Assert.AreNotEqual(a, b);
            Assert.AreNotEqual(a.GetHashCode(), b.GetHashCode());
        }
Exemple #4
0
        public void Different_NumTestRuns()
        {
            var a = new InteractionStatistics();
            var b = new InteractionStatistics
            {
                NumTestRuns = 5
            };

            Assert.AreNotEqual(a, b);
            Assert.AreNotEqual(a.GetHashCode(), b.GetHashCode());
        }
Exemple #5
0
        public void Different_NumCodeCompletion()
        {
            var a = new InteractionStatistics();
            var b = new InteractionStatistics
            {
                NumCodeCompletion = 4
            };

            Assert.AreNotEqual(a, b);
            Assert.AreNotEqual(a.GetHashCode(), b.GetHashCode());
        }
Exemple #6
0
        public void Different_Position()
        {
            var a = new InteractionStatistics();
            var b = new InteractionStatistics
            {
                Position = Positions.Student
            };

            Assert.AreNotEqual(a, b);
            Assert.AreNotEqual(a.GetHashCode(), b.GetHashCode());
        }
Exemple #7
0
        public void Different_Education()
        {
            var a = new InteractionStatistics();
            var b = new InteractionStatistics
            {
                Education = Educations.Bachelor
            };

            Assert.AreNotEqual(a, b);
            Assert.AreNotEqual(a.GetHashCode(), b.GetHashCode());
        }
Exemple #8
0
        public void Different_DayLast()
        {
            var now = DateTime.Now;
            var a   = new InteractionStatistics();
            var b   = new InteractionStatistics
            {
                DayLast = now
            };

            Assert.AreNotEqual(a, b);
            Assert.AreNotEqual(a.GetHashCode(), b.GetHashCode());
        }
Exemple #9
0
        public void Different_NumEventsDetails()
        {
            var a = new InteractionStatistics();
            var b = new InteractionStatistics
            {
                NumEventsDetailed =
                {
                    { typeof(int), 1 }
                }
            };

            Assert.AreNotEqual(a, b);
            Assert.AreNotEqual(a.GetHashCode(), b.GetHashCode());
        }
Exemple #10
0
        public void ReallyEqual()
        {
            var now = DateTime.Now;
            var a   = new InteractionStatistics
            {
                DayFirst          = now,
                DayLast           = now,
                NumDays           = 1,
                NumMonth          = 2,
                NumEventsDetailed =
                {
                    { typeof(int), 3 }
                },
                Education         = Educations.Bachelor,
                Position          = Positions.Student,
                NumCodeCompletion = 4,
                NumTestRuns       = 5,
                ActiveTime        = TimeSpan.FromSeconds(3)
            };
            var b = new InteractionStatistics
            {
                DayFirst          = now,
                DayLast           = now,
                NumDays           = 1,
                NumMonth          = 2,
                NumEventsDetailed =
                {
                    { typeof(int), 3 }
                },
                Education         = Educations.Bachelor,
                Position          = Positions.Student,
                NumCodeCompletion = 4,
                NumTestRuns       = 5,
                ActiveTime        = TimeSpan.FromSeconds(3)
            };

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