예제 #1
0
        public static void Initialize(TestContext context)
        {
            ILoggerFactory loggerFactory = LoggerFactory.Create(
                builder => builder.AddTestsLogging(context));

            _config = Result <TelegramConfig> .Failure("Default config");

            var configsProvider = new MockConfigProvider();

            configsProvider.Configs.Subscribe(result => _config = result);

            _bot = new TelegramBot(
                configsProvider,
                new MessageBuilder(new TelegramConfig
            {
                FilterRules = new []
                {
                    new FilterRule
                    {
                        UserNames         = new [] { "mock-user" },
                        DisableMedia      = true,
                        HideMessagePrefix = true
                    }
                }
            }),
                new MockTelegramBotClientProvider(loggerFactory),
                loggerFactory);
        }
예제 #2
0
        public static void Initialize(TestContext context)
        {
            ILoggerFactory loggerFactory = LoggerFactory.Create(
                builder => builder.AddTestsLogging(context));

            _config = Result <TelegramConfig> .Failure("Default config");

            var configsProvider = new MockConfigProvider();

            configsProvider.Configs.Subscribe(result => _config = result);

            _bot = new TelegramBot(
                configsProvider,
                new MessageBuilder(new TelegramConfig()),
                new MockTelegramBotClientProvider(loggerFactory),
                loggerFactory);
        }