public IActionResult Task3Result(string inputString) { if (String.IsNullOrWhiteSpace(inputString)) { return(BadRequest("Входная трока не может быть пустой")); } string result = String.Empty; var counter = new CharactersCounter(); try { if (counter.TryGetMissedCharacter(inputString.ToCharArray(), out var missedCharacter)) { result += "Пропущенная буква: " + missedCharacter; } else { result = "Пропущенная буква не найдена"; } } catch (ArgumentOutOfRangeException) { result = "Входная строка не должна содержать символов кроме букв английского алфавита"; } return(Ok(result)); }
public void Count_Set_1() { Assert.AreEqual("11100000000000000000000000000000000000", CharactersCounter.Count("ABC")); }
public void Count_numbers() { Assert.AreEqual("00000000000000000000000000001111111111", CharactersCounter.Count("1234567890")); }
public void Count_single_quote() { Assert.AreEqual("00000000000000000000000000010000000000", CharactersCounter.Count("\'")); }
public void Count_hyphen() { Assert.AreEqual("00000000000000000000000000100000000000", CharactersCounter.Count("-")); }
public void Count_Case_Insensitive() { Assert.AreEqual("01113000000010000100000000000000000000", CharactersCounter.Count("DECEMBER")); }
public void Count_Set_3() { Assert.AreEqual("01113000000010000100000000000000000000", CharactersCounter.Count("December")); }