Exemplo n.º 1
0
        public void TestReplaceSingleItemCollectionWithMatch()
        {
            var covidCollection = new CovidDataCollection {
                this.record1
            };
            var recordBeforeChange = covidCollection[0];
            var isReplaced         = covidCollection.ReplaceDuplicateRecords(this.record2);
            var recordAfterChange  = covidCollection[0];

            Assert.AreNotEqual(this.record2.PositiveTests, recordBeforeChange.PositiveTests);
            Assert.IsTrue(isReplaced);
            Assert.AreEqual(this.record2.PositiveTests, recordAfterChange.PositiveTests);
        }
Exemplo n.º 2
0
        public void TestReplaceMultipleItemCollection()
        {
            var covidCollection = new CovidDataCollection {
                this.record1,
                this.record3
            };
            var recordBeforeChange = covidCollection[0];
            var isReplaced         = covidCollection.ReplaceDuplicateRecords(this.record2);
            var recordAfterChange  = covidCollection[1];
            var unalteredRecord    = covidCollection[0];

            Assert.AreNotEqual(this.record2.PositiveTests, recordBeforeChange.PositiveTests);
            Assert.IsTrue(isReplaced);
            Assert.AreEqual(this.record2.PositiveTests, recordAfterChange.PositiveTests);
            Assert.AreEqual(this.record3.PositiveTests, unalteredRecord.PositiveTests);
        }
Exemplo n.º 3
0
        public void TestReplaceEmptyCollection()
        {
            var covidCollection = new CovidDataCollection();

            Assert.IsFalse(covidCollection.ReplaceDuplicateRecords(this.record1));
        }