Example #1
0
        public void Defaults()
        {
            var sut = new EditLocationResults();

            Assert.AreEqual("", sut.Zip);
            Assert.AreEqual(0, sut.NumCompletionEvents);
            Assert.AreEqual(0, sut.NumEvents);
            Assert.AreEqual(0, sut.NumLocations);
            Assert.AreEqual(Lists.NewList <RelativeEditLocation>(), sut.AppliedEditLocations);
            Assert.AreEqual(Lists.NewList <RelativeEditLocation>(), sut.OtherEditLocations);

            Assert.AreNotEqual(0, sut.GetHashCode());
            Assert.AreNotEqual(1, sut.GetHashCode());
        }
Example #2
0
        public void Equality_Default()
        {
            var a = new EditLocationResults();
            var b = new EditLocationResults();

            Assert.AreEqual(a, b);
            Assert.AreEqual(a.GetHashCode(), b.GetHashCode());
        }
Example #3
0
        public void Equality_DifferentNumHistoryTuples()
        {
            var a = new EditLocationResults
            {
                NumLocations = 5
            };
            var b = new EditLocationResults();

            Assert.AreNotEqual(a, b);
            Assert.AreNotEqual(a.GetHashCode(), b.GetHashCode());
        }
Example #4
0
        public void Equality_DifferentNumEvents()
        {
            var a = new EditLocationResults
            {
                NumEvents = 3
            };
            var b = new EditLocationResults();

            Assert.AreNotEqual(a, b);
            Assert.AreNotEqual(a.GetHashCode(), b.GetHashCode());
        }
Example #5
0
        public void Equality_DifferentZip()
        {
            var a = new EditLocationResults
            {
                Zip = "a"
            };
            var b = new EditLocationResults();

            Assert.AreNotEqual(a, b);
            Assert.AreNotEqual(a.GetHashCode(), b.GetHashCode());
        }
Example #6
0
        public void Equality_DifferentOtherEditLocations()
        {
            var a = new EditLocationResults
            {
                OtherEditLocations =
                {
                    new RelativeEditLocation {
                        Location = 1, Size = 2
                    }
                }
            };
            var b = new EditLocationResults();

            Assert.AreNotEqual(a, b);
            Assert.AreNotEqual(a.GetHashCode(), b.GetHashCode());
        }
Example #7
0
        public void Equality_WithValuesSet()
        {
            var a = new EditLocationResults
            {
                Zip = "a",
                NumCompletionEvents  = 1,
                NumEvents            = 3,
                NumLocations         = 5,
                AppliedEditLocations =
                {
                    new RelativeEditLocation {
                        Location = 1, Size = 2
                    }
                },
                OtherEditLocations =
                {
                    new RelativeEditLocation {
                        Location = 3, Size = 4
                    }
                }
            };
            var b = new EditLocationResults
            {
                Zip = "a",
                NumCompletionEvents  = 1,
                NumEvents            = 3,
                NumLocations         = 5,
                AppliedEditLocations =
                {
                    new RelativeEditLocation {
                        Location = 1, Size = 2
                    }
                },
                OtherEditLocations =
                {
                    new RelativeEditLocation {
                        Location = 3, Size = 4
                    }
                }
            };

            Assert.AreEqual(a, b);
            Assert.AreEqual(a.GetHashCode(), b.GetHashCode());
        }
Example #8
0
        public void Add()
        {
            var a = new EditLocationResults
            {
                Zip = "a",
                NumCompletionEvents  = 1,
                NumEvents            = 3,
                NumLocations         = 5,
                AppliedEditLocations =
                {
                    new RelativeEditLocation {
                        Location = 1, Size = 2
                    }
                },
                OtherEditLocations =
                {
                    new RelativeEditLocation {
                        Location = 3, Size = 4
                    }
                }
            };

            a.Add(
                new EditLocationResults
            {
                Zip = "b",
                NumCompletionEvents  = 1 + 1,
                NumEvents            = 3 + 1,
                NumLocations         = 5 + 1,
                AppliedEditLocations =
                {
                    new RelativeEditLocation {
                        Location = 1, Size = 3
                    }
                },
                OtherEditLocations =
                {
                    new RelativeEditLocation {
                        Location = 4, Size = 5
                    }
                }
            });
            var b = new EditLocationResults
            {
                Zip = "a",
                NumCompletionEvents  = 2 * 1 + 1,
                NumEvents            = 2 * 3 + 1,
                NumLocations         = 2 * 5 + 1,
                AppliedEditLocations =
                {
                    new RelativeEditLocation {
                        Location = 1, Size = 2
                    },
                    new RelativeEditLocation {
                        Location = 1, Size = 3
                    }
                },
                OtherEditLocations =
                {
                    new RelativeEditLocation {
                        Location = 3, Size = 4
                    },
                    new RelativeEditLocation {
                        Location = 4, Size = 5
                    }
                }
            };

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