Esempio n. 1
0
        public async Task NoOpQueryReturnsMessage(string query)
        {
            using (SelfCleaningTempFile queryTempFile = new SelfCleaningTempFile())
                using (TestServiceDriverProvider testService = new TestServiceDriverProvider())
                {
                    Assert.True(await testService.Connect(TestServerType.OnPrem, queryTempFile.FilePath));
                    // If: the query is executed...
                    var queryResult = await testService.RunQueryAsync(queryTempFile.FilePath, query);

                    var message = await testService.WaitForMessage();

                    // Then:
                    // ... I expect a query result to indicate successfully started query
                    Assert.NotNull(queryResult);

                    // ... I expect a non-error message to be returned without a batch associated with it
                    Assert.NotNull(message);
                    Assert.NotNull(message.Message);
                    Assert.NotNull(message.Message.Message);
                    Assert.False(message.Message.IsError);
                    Assert.Null(message.Message.BatchId);

                    await testService.Disconnect(queryTempFile.FilePath);
                }
        }