Пример #1
0
        public void UpdateAdultBodyMass_OriginalObjectNotMutated()
        {
            decimal originalMass = _original.AdultBodymass;

            var updated = DogProfileHelpers.UpdateAdultBodyMass(_original, 100);

            Assert.AreEqual(originalMass, _original.AdultBodymass);
        }
Пример #2
0
        public void UpdateAdultBodyMass_OtherValuesUnaffected()
        {
            var updated = DogProfileHelpers.UpdateAdultBodyMass(_original, 100);

            Assert.AreEqual(_original.AgeAtDeath, updated.AgeAtDeath);
            Assert.AreEqual(_original.Sex, updated.Sex);
            Assert.AreEqual(_original.Breed, updated.Breed);
            Assert.AreEqual(_original.HouseholdIncome, updated.HouseholdIncome);
        }
Пример #3
0
        public void UpdateAdultBodyMass_CorrectlyUpdatesValue()
        {
            var updated = DogProfileHelpers.UpdateAdultBodyMass(_original, 100);

            Assert.AreEqual(100, updated.AdultBodymass);
        }
        public void NormaliseMasses_AllAgesAreSameValue_NormaliseToHalf()
        {
            var result = _data.Select(x => DogProfileHelpers.UpdateAdultBodyMass(x, 2m)).NormaliseMasses();

            Assert.IsTrue(result.All(x => x.AdultBodymass == 0.5m));
        }