SqlServerDatabaseProviderTests.cs 872 B

123456789101112131415161718192021222324252627
  1. using PetaPoco.Providers;
  2. using Shouldly;
  3. using Xunit;
  4. namespace PetaPoco.Tests.Unit.Providers
  5. {
  6. public class SqlServerDatabaseProviderTests
  7. {
  8. private readonly SqlServerDatabaseProvider _provider = new SqlServerDatabaseProvider();
  9. [Theory]
  10. [InlineData("column.name", "[column.name]")]
  11. [InlineData("column name", "[column name]")]
  12. public void EscapeSqlIdentifier_GivenInput_ShouldBeExpected(string input, string expected)
  13. {
  14. _provider.EscapeSqlIdentifier(input).ShouldBe(expected);
  15. }
  16. [Theory]
  17. [InlineData("column.name", "column.name")]
  18. [InlineData("column name", "[column name]")]
  19. public void EscapeTableName_GivenInput_ShouldBeExpected(string input, string expected)
  20. {
  21. _provider.EscapeTableName(input).ShouldBe(expected);
  22. }
  23. }
  24. }