Esempio n. 1
0
        public async void ScriptSchemaCancel()
        {
            using (TestServiceDriverProvider testService = new TestServiceDriverProvider())
            {
                ScriptingParams requestParams = new ScriptingParams
                {
                    ScriptDestination = "ToEditor",
                    ConnectionString  = this.Northwind.ConnectionString,
                    ScriptOptions     = new ScriptOptions
                    {
                        TypeOfDataToScript = "SchemaAndData",
                    }
                };

                var result = Task.Run(() => testService.Script(requestParams));
                ScriptingProgressNotificationParams progressParams = await testService.Driver.WaitForEvent(ScriptingProgressNotificationEvent.Type, TimeSpan.FromSeconds(10));

                Task.Run(() => testService.CancelScript(progressParams.OperationId));
                ScriptingCompleteParams cancelEvent = await testService.Driver.WaitForEvent(ScriptingCompleteEvent.Type, TimeSpan.FromSeconds(10));

                Assert.True(cancelEvent.Canceled);
            }
        }
        public async Task ScriptSchemaCancel()
        {
            using (TestServiceDriverProvider testService = new TestServiceDriverProvider())
                using (SelfCleaningTempFile tempFile = new SelfCleaningTempFile())
                {
                    ScriptingParams requestParams = new ScriptingParams
                    {
                        FilePath         = tempFile.FilePath,
                        ConnectionString = this.Northwind.ConnectionString,
                        ScriptOptions    = new ScriptOptions
                        {
                            TypeOfDataToScript = "SchemaAndData",
                        },
                    };

                    ScriptingResult result = await testService.Script(requestParams);

                    ScriptingCancelResult cancelResult = await testService.CancelScript(result.OperationId);

                    ScriptingCompleteParams cancelEvent = await testService.Driver.WaitForEvent(ScriptingCompleteEvent.Type, TimeSpan.FromSeconds(10));

                    Assert.True(cancelEvent.Canceled);
                }
        }