private void AssertCreation(DigitRepresentation representation) { var result = LCDDigitFactory.Create(representation); Assert.NotNull(result); Assert.IsType <LCDDigit>(result); }
public IEnumerable<Digit> GetPossibleDigits(DigitRepresentation possibleBrokenDigitRepresentation) { for (int column = 0; column < 3; column++) { for (int row = 0; row < 3; row++) { foreach (var newChar in new[] { '|', ' ' }) { var matchedMarkAdded = ModifyAndAttemptToMatch(possibleBrokenDigitRepresentation, column, row, newChar: newChar); if (matchedMarkAdded.IsValid) yield return matchedMarkAdded; } } } }
private void AssertDigitRepresentation(int digit, DigitRepresentation representation) { Assert.Equal(representation, DigitRepresentationConverter.Convert(digit)); }
public static LCDDigit Create(DigitRepresentation digit) { return(MANUFACTURERS[digit].Create()); }
private static Digit ModifyAndAttemptToMatch(DigitRepresentation possibleBrokenDigitRepresentation, int column, int row, char newChar) { var newPossibleDigitRepresentation = possibleBrokenDigitRepresentation.ChangeAt(row: row, column: column, newChar: newChar); var matched = DigitTemplates.TryToMatchDigitRepresentationWithAnyOfTemplates(newPossibleDigitRepresentation); return matched; }
public LCDDigit(DigitRepresentation digitRepresentation) { this.DigitRepresentation = digitRepresentation; }