private void VerifySignalsAreCloned(LivingInfectedCell sut, ICell result, ushort signals, ICellVisitor visitor) { sut.Accept(visitor); result.Accept(visitor); Mock.Get(visitor) .Verify(v => v.VisitCell( It.IsAny <bool>(), It.Is <ushort>(self => self == signals), It.Is <ushort>(alert => alert == signals)), Times.Exactly(2)); }
public (ConsoleColor, string) GetColorEncodedCell(ICell cell) { (_colorCode, _currentCellCode) = cell switch { InfectedCell _ => (ConsoleColor.Red, "I"), HealthyCell _ => (ConsoleColor.Green, "C"), _ => (ConsoleColor.DarkYellow, string.Empty) }; cell?.Accept(this); return(_colorCode, _currentCellCode); }
public string GetEncodedCell(ICell cell) { _currentCellCode = cell switch { InfectedCell _ => "I", HealthyCell _ => "C", _ => string.Empty }; cell?.Accept(this); return(_currentCellCode); }