mirror of
https://github.com/ckaczor/sqltoolsservice.git
synced 2026-01-14 01:25:40 -05:00
Include ManagedBatchParser tests to improve code coverage (#793)
* Include ManagedBatchParser test to improve code coverage * Fix some failing test cases and revert appveyor.yml
This commit is contained in:
@@ -0,0 +1,36 @@
|
||||
//
|
||||
// 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.Collections.Generic;
|
||||
using System.Text;
|
||||
using Microsoft.SqlTools.ServiceLayer.BatchParser;
|
||||
using Microsoft.SqlTools.ServiceLayer.BatchParser.ExecutionEngineCode;
|
||||
|
||||
namespace Microsoft.SqlTools.ManagedBatchParser.UnitTests.BatchParser
|
||||
{
|
||||
internal sealed class TestVariableResolver : IVariableResolver
|
||||
{
|
||||
private StringBuilder outputString;
|
||||
private BatchParserSqlCmd batchParserSqlCmd;
|
||||
|
||||
public TestVariableResolver(StringBuilder outputString)
|
||||
{
|
||||
this.outputString = outputString;
|
||||
batchParserSqlCmd = new BatchParserSqlCmd();
|
||||
}
|
||||
|
||||
public string GetVariable(PositionStruct pos, string name)
|
||||
{
|
||||
return batchParserSqlCmd.GetVariable(pos, name);
|
||||
}
|
||||
|
||||
public void SetVariable(PositionStruct pos, string name, string value)
|
||||
{
|
||||
outputString.AppendFormat("Setting variable {0} to [{1}]\n", name, value);
|
||||
batchParserSqlCmd.SetVariable(pos, name, value);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user