Beispiel #1
0
        public void Test1()
        {
            var service      = new MessageOnKitchen(null);
            var responseEnum = service.CommandForBot("/command");

            Assert.True(responseEnum == ResponseForUser.None);
        }
        public BotTelegramHostedService(ILogger <BotTelegramHostedService> logger, IServiceProvider serviceProvider)
        {
            _logger = logger;

            using (var scope = serviceProvider.CreateScope())
            {
                var connectionString = Environment.GetEnvironmentVariable("ConnectionString");
                var context          = new Context(connectionString);
                _bot = scope.ServiceProvider.GetService <ITelegramBotClient>();
                _messageOnShipBusiness = new MessageOnKitchen(context);
            }
        }