public void GetNumberSystemErrorMessage(NumberSystem numberSystem) { // arrange // act var result = NumberConversionStrategy.GetNumberSystemErrorMessage(numberSystem); // assert Assert.Contains(numberSystem.ToString(), result); }
public void Convert() { try { ErrorMessage = null; if (string.IsNullOrEmpty(EntryValue)) { throw new FormatException(); } var valueAsInt = NumberConversionStrategy.ConvertFrom(EntryValue, EntryNumberSystem); ResultValue = NumberConversionStrategy.ConvertTo(valueAsInt, ResultNumberSystem); } catch { ErrorMessage = NumberConversionStrategy.GetNumberSystemErrorMessage(EntryNumberSystem); } }