Beispiel #1
0
        internal void VirusDoesNotInfectAlreadyInfectedCellsOrNullCells(
            InfectedCell infectedCellToInfect,
            NullCell nullCellToInfect,
            LyticVirus sut)
        {
            var result        = new List <ICell>();
            var numberOfTries = (int)Ceiling(InfectionFailureRate * 3 * 10);

            for (int currentTry = 0; currentTry < numberOfTries; currentTry++)
            {
                result.Add(sut.InfectCell(infectedCellToInfect).Clone());
                result.Add(sut.InfectCell(nullCellToInfect).Clone());
            }

            VerifyNoNewlyInfectedCellsArePresent(result, numberOfTries);
        }
Beispiel #2
0
        internal void VirusCanInfectHealthyCellsInOneOutOfTenTimes(
            HealthyCell cellToInfect,
            LyticVirus sut)
        {
            var result        = new List <ICell>();
            var numberOfTries = (int)Ceiling(InfectionFailureRate * 3 * 10);

            for (int currentTry = 0; currentTry < numberOfTries; currentTry++)
            {
                result.Add(sut.InfectCell(cellToInfect).Clone());
            }

            VerifyAtLeastOneCellGotInfected(result);
        }