コード例 #1
0
ファイル: LyticVirusTest.cs プロジェクト: maschmi/germgame
        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);
        }
コード例 #2
0
ファイル: LyticVirusTest.cs プロジェクト: maschmi/germgame
        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);
        }