コード例 #1
0
        public IService GetAvtoCarDriveService(string token)
        {
            var telegramBotClient       = new TelegramBotClient(token);
            var adminIdsService         = new AdminIdsService();
            var carService              = new CarService();
            var messageProcessorFactory = new MessageProcessorFactory(_logger, telegramBotClient, adminIdsService, carService);
            var messageTypeIdentifier   = new MessageTypeIdentifier();

            return(new AvtoCarDriveService(new TelegramBotClient(token),
                                           new MessageProcessor(_logger, telegramBotClient, messageProcessorFactory, adminIdsService,
                                                                messageTypeIdentifier)));
        }
コード例 #2
0
        public void GetAdminIds_TheExpectedIdsWasGot()
        {
            // Arrange
            _target.SetAdminId(111111);
            _target.SetAdminId(222222);
            _target.SetAdminId(333333);
            _target.SetAdminId(444444);

            var expectedListOfAdmins = new List <long>
            {
                111111,
                222222,
                333333,
                444444
            };

            // Act
            _target = new AdminIdsService(Environment.CurrentDirectory + "/TestData");
            var actualListOfAdmin = _target.AdminIds;

            // Assert
            CollectionAssert.AreEqual(expectedListOfAdmins, actualListOfAdmin);
        }
コード例 #3
0
        public void InitializeTest()
        {
            RemoveDataFile();

            _target = new AdminIdsService(Environment.CurrentDirectory + "/TestData");
        }