mirror of
https://github.com/ckaczor/sqltoolsservice.git
synced 2026-01-14 09:59:48 -05:00
* Created New ManagedBatchParser project in .NetStandard * Addressing PR Comments * Resolve 'No Repository' warning. * Move batch parser tests to integrations test project * Fix SLN file
53 lines
1.8 KiB
C#
53 lines
1.8 KiB
C#
//
|
|
// Copyright (c) Microsoft. All rights reserved.
|
|
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
|
//
|
|
|
|
using System;
|
|
using System.Data.SqlClient;
|
|
using System.Diagnostics;
|
|
using Microsoft.SqlTools.ServiceLayer.BatchParser.ExecutionEngineCode;
|
|
|
|
namespace Microsoft.SqlTools.ManagedBatchParser.UnitTests.BatchParser
|
|
{
|
|
internal class BatchParserMockEventHandler : IBatchEventsHandler
|
|
{
|
|
public SqlError Error { get; private set; }
|
|
|
|
/// <summary>
|
|
/// fired when there is an error message from the server
|
|
/// </summary>
|
|
public void OnBatchError(object sender, BatchErrorEventArgs args)
|
|
{
|
|
Debug.WriteLine("{0}", args.Message);
|
|
Error = args.Error;
|
|
}
|
|
|
|
/// <summary>
|
|
/// fired when there is a message from the server
|
|
/// </summary>
|
|
public void OnBatchMessage(object sender, BatchMessageEventArgs args)
|
|
{
|
|
Debug.WriteLine("{0}", args.Message);
|
|
}
|
|
|
|
/// <summary>
|
|
/// fired when there is a new result set available. It is guarnteed
|
|
/// to be fired from the same thread that called Execute method
|
|
/// </summary>
|
|
public void OnBatchResultSetProcessing(object sender, BatchResultSetEventArgs args) { }
|
|
|
|
/// <summary>
|
|
/// fired when we've done absolutely all actions for the current result set
|
|
/// </summary>
|
|
public void OnBatchResultSetFinished(object sender, EventArgs args) { }
|
|
|
|
/// <summary>
|
|
/// fired when the batch recieved cancel request BEFORE it
|
|
/// initiates cancel operation. Note that it is fired from a
|
|
/// different thread then the one used to kick off execution
|
|
/// </summary>
|
|
public void OnBatchCancelling(object sender, EventArgs args) { }
|
|
}
|
|
}
|