public void DataValidator_WorksAsExpected(string date, bool expected) { // Act - bool actual = DateValidator.CheckIfDataIsValid(date); // Assert - Assert.AreEqual(expected, actual); }
public async Task DolarDia(CommandContext ctx, string date) { bool dateIsValid = DateValidator.CheckIfDataIsValid(date); if (dateIsValid) { await SendPokedollarMessageForGivenDate(ctx, date); } else { await ErrorMessageCreator.CreateErrorMessageBecauseOfInvalidDate(ctx); } }
public async Task NasaWithGivenDate(CommandContext ctx, [Description("Data desejada")] string date) { bool dateIsValid = DateValidator.CheckIfDataIsValid(date); if (dateIsValid) { await SendNasaPictureForGivenDate(ctx, date); } else { await AlertUserThereWasAnErrorWithTheDate(ctx); } }