Beispiel #1
0
        public void SetDefaultValueInputsGetValidated()
        {
            var mock = new Mock <ITelegramBotMapper>();

            TelegramModule.Initialize(ApiKey, 10);
            TelegramModule.Bot = mock.Object;

            Assert.Contains(nameof(ArgumentException), TelegramModule.SetDefaultValue(string.Empty, "some text"));
            Assert.Contains(nameof(ArgumentException), TelegramModule.SetDefaultValue("some text", string.Empty));
        }
Beispiel #2
0
        public void DefaultValuesAreSet()
        {
            TelegramModule.Initialize(ApiKey, 10);

            TelegramModule.SetDefaultValue(nameof(TelegramModule.Bot.DisableNotifications), "true");
            TelegramModule.SetDefaultValue(nameof(TelegramModule.Bot.DisableWebPagePreview), "true");
            TelegramModule.SetDefaultValue(nameof(TelegramModule.Bot.ParseMode), "html");
            Assert.True(TelegramModule.Bot.DisableNotifications);
            Assert.True(TelegramModule.Bot.DisableWebPagePreview);
            Assert.True(TelegramModule.Bot.ParseMode == ParseMode.Html);
        }