Ejemplo n.º 1
0
        public async Task ProcessEventsInsertServiceTests()
        {
            var processEventsId = 7999;
            var cmd             = $"INSERT INTO PROCESS_EVENTS (ID) VALUES ({processEventsId});";

            var sqlExecuter = new FbSqlExecuter(TestsContext.MainDbConnectionString);

            sqlExecuter.ExecuteNonQuery($"DELETE FROM PROCESS_EVENTS WHERE ID = {processEventsId}",
                                        (ex) => { });

            using (var testEngine = new DbAgentServiceTestEngine <ProcessEventsActionModel>())
            {
                await testEngine.CaptureModel(cmd, (model) => model.Id == processEventsId);
            }

            sqlExecuter.ExecuteNonQuery($"DELETE FROM PROCESS_EVENTS WHERE ID = {processEventsId}",
                                        (ex) => { });
        }
Ejemplo n.º 2
0
        public async Task <TModel> CaptureModel(string insertCommand, Func <TModel, bool> findModelFunc)
        {
            _service.ModelsSentToRedis += OnModelsSent;
            _service.Start();

            var sqlExecuter = new FbSqlExecuter(TestsContext.MainDbConnectionString);

            sqlExecuter.ExecuteNonQuery(insertCommand);

            var model = await WaitForModel(TimeSpan.FromSeconds(10), findModelFunc);

            return(model);
        }