public void ShouldConvertScoreCardOfMixedItems() { var items = _converter.Convert("X|7/|9-|X|-8|8/|-6|X|X|X||81"); var result = new List <int>() { 10, 7, 3, 9, 0, 10, 0, 8, 8, 2, 0, 6, 10, 10, 10, 8, 1 }; for (int i = 0; i < items.Count(); i++) { Assert.AreEqual(result.ElementAt(i), items.ElementAt(i)); } }
public IEnumerable <int> Convert(string scoreCard) { try { _logger.LogDebug($"Converting score card [{scoreCard}]"); var roles = _converter.Convert(scoreCard); _logger.LogDebug($"Converted score card [{scoreCard}] to {JsonConvert.SerializeObject(roles)}:"); return(roles); } catch (Exception e) { _logger.LogError(new EventId(), e, $"Converting score card [{scoreCard}] failed"); throw; } }