예제 #1
0
        public void DataValidator_WorksAsExpected(string date, bool expected)
        {
            // Act -
            bool actual = DateValidator.CheckIfDataIsValid(date);

            // Assert -
            Assert.AreEqual(expected, actual);
        }
예제 #2
0
        public async Task DolarDia(CommandContext ctx, string date)
        {
            bool dateIsValid = DateValidator.CheckIfDataIsValid(date);

            if (dateIsValid)
            {
                await SendPokedollarMessageForGivenDate(ctx, date);
            }
            else
            {
                await ErrorMessageCreator.CreateErrorMessageBecauseOfInvalidDate(ctx);
            }
        }
예제 #3
0
        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);
            }
        }