Skip to content

Tests | Move various unit tests to UnitTests project #3458

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 15 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ internal SqlCommandSet() : base()
_commandList = new List<SqlBatchCommand>();
}

private SqlCommand BatchCommand
internal SqlCommand BatchCommand
{
get
{
Expand All @@ -45,7 +45,7 @@ private SqlCommand BatchCommand

internal int CommandCount => CommandList.Count;

private List<SqlBatchCommand> CommandList
internal List<SqlBatchCommand> CommandList
{
get
{
Expand Down Expand Up @@ -98,24 +98,16 @@ internal void Append(SqlCommand command)
{
ADP.CheckArgumentNull(command, nameof(command));
SqlClientEventSource.Log.TryTraceEvent("SqlCommandSet.Append | API | Object Id {0}, Command '{1}', Parameter Count {2}", ObjectID, command.ObjectID, command.Parameters.Count);

// SqlCommandSet only supports commands of type Text or StoredProcedure. This aligns with SqlCommand (validated by its CommandType setter.)
Debug.Assert(command.CommandType is CommandType.Text or CommandType.StoredProcedure);

string cmdText = command.CommandText;
if (string.IsNullOrEmpty(cmdText))
{
throw ADP.CommandTextRequired(nameof(Append));
}

CommandType commandType = command.CommandType;
switch (commandType)
{
case CommandType.Text:
case CommandType.StoredProcedure:
break;
case CommandType.TableDirect:
throw SQL.NotSupportedCommandType(commandType);
default:
throw ADP.InvalidCommandType(commandType);
}

SqlParameterCollection parameters = null;

SqlParameterCollection collection = command.Parameters;
Expand Down Expand Up @@ -279,7 +271,7 @@ internal bool GetBatchedAffected(int commandIdentifier, out int recordsAffected,
internal int GetParameterCount(int commandIndex)
=> CommandList[commandIndex].Parameters.Count;

private void ValidateCommandBehavior(string method, CommandBehavior behavior)
internal void ValidateCommandBehavior(string method, CommandBehavior behavior)
{
if (0 != (behavior & ~(CommandBehavior.SequentialAccess | CommandBehavior.CloseConnection)))
{
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,7 @@
<Compile Include="MultipartIdentifierTests.cs" />
<Compile Include="MultiplexerTests.cs" />
<Compile Include="SqlAuthenticationProviderTest.cs" />
<Compile Include="SqlBufferTests.cs" />
<Compile Include="SqlClientLoggerTest.cs" />
<Compile Include="SqlCommandSetTest.cs" />
<Compile Include="LocalAppContextSwitchesTests.cs" />
<Compile Include="SqlConfigurableRetryLogicTest.cs" />
<Compile Include="SqlCommandBuilderTest.cs" />
<Compile Include="SqlBulkCopyTest.cs" />
Expand Down
253 changes: 0 additions & 253 deletions src/Microsoft.Data.SqlClient/tests/FunctionalTests/SqlBufferTests.cs

This file was deleted.

Loading
Loading