Exemplo n.º 1
0
        public void Operate_ConditionPassesForOneElement_OneMutationDesired_ReturnsCorrectlyMutatedDv()
        {
            var mutator = new MutationConditional(
                insideMutation,
                o => Convert.ToDouble(o) < 0.01);

            var newDv = mutator.Operate(testDv);

            Assert.NotEqual(testDv, newDv);
            Assert.Equal(testDv.Count, newDv.Count);
            var changedValue = Convert.ToDouble(newDv.Last());
            var oldValue     = Convert.ToDouble(testDv.Last());

            Assert.True(Math.Abs(Math.Abs(oldValue - changedValue) - mutation) < 1e-8);
        }