You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
36 lines
936 B
C#
36 lines
936 B
C#
using System.Data.Jet;
|
|
using System.Data.SqlClient;
|
|
using Xunit;
|
|
|
|
namespace EntityFramework.Jet.FunctionalTests
|
|
{
|
|
public class JetCommandDisposeTest
|
|
{
|
|
[Fact]
|
|
public void JetCommandCannotBeLoggedAfterDispose()
|
|
{
|
|
var command = new JetCommand();
|
|
|
|
command.CommandText = "foo";
|
|
command.Parameters.Add(command.CreateParameter());
|
|
command.Dispose();
|
|
|
|
Assert.Equal(command.CommandText, string.Empty);
|
|
Assert.Equal(command.Parameters.Count, 0);
|
|
}
|
|
|
|
[Fact]
|
|
public void SqlCommandCanBeLoggedAfterDispose()
|
|
{
|
|
var command = new SqlCommand();
|
|
|
|
command.CommandText = "bar";
|
|
command.Parameters.Add(new SqlParameter());
|
|
command.Dispose();
|
|
|
|
Assert.Equal(command.CommandText, "bar");
|
|
Assert.Equal(command.Parameters.Count, 1);
|
|
}
|
|
}
|
|
}
|