<commit_before>﻿using System.Data.SqlClient;
using FluentMigrator.Runner.Generators;
using FluentMigrator.Runner.Processors;
using FluentMigrator.Tests.Helpers;
using Xunit;

namespace FluentMigrator.Tests.Integration.Processors
{
	public class SqlServerProcessorTests
	{
		public SqlConnection Connection { get; set; }
		public SqlServerProcessor Processor { get; set; }

		public SqlServerProcessorTests()
		{
			Connection = new SqlConnection(@"server=(local)\SQLSERVER2005;uid=;pwd=;Trusted_Connection=yes;database=FluentMigrator");
			Connection.Open();

			Processor = new SqlServerProcessor(Connection, new SqlServerGenerator());
		}

		[Fact]
		public void CallingTableExistsReturnsTrueIfTableExists()
		{
			using (var table = new SqlServerTestTable(Connection, "id int"))
				Assert.True(Processor.TableExists(table.Name));
		}

		[Fact]
		public void CallingTableExistsReturnsFalseIfTableDoesNotExist()
		{
			Assert.False(Processor.TableExists("DoesNotExist"));
		}

		[Fact]
		public void CallingColumnExistsReturnsTrueIfColumnExists()
		{
			using (var table = new SqlServerTestTable(Connection, "id int"))<commit_msg>Removed sql server named instance.<commit_after>﻿using System.Data.SqlClient;
using FluentMigrator.Runner.Generators;
using FluentMigrator.Runner.Processors;
using FluentMigrator.Tests.Helpers;
using Xunit;

namespace FluentMigrator.Tests.Integration.Processors
{
	public class SqlServerProcessorTests
	{
		public SqlConnection Connection { get; set; }
		public SqlServerProcessor Processor { get; set; }

		public SqlServerProcessorTests()
		{
			Connection = new SqlConnection(@"server=(local);uid=;pwd=;Trusted_Connection=yes;database=FluentMigrator");
			Connection.Open();

			Processor = new SqlServerProcessor(Connection, new SqlServerGenerator());
		}

		[Fact]
		public void CallingTableExistsReturnsTrueIfTableExists()
		{
			using (var table = new SqlServerTestTable(Connection, "id int"))
				Assert.True(Processor.TableExists(table.Name));
		}

		[Fact]
		public void CallingTableExistsReturnsFalseIfTableDoesNotExist()
		{
			Assert.False(Processor.TableExists("DoesNotExist"));
		}

		[Fact]
		public void CallingColumnExistsReturnsTrueIfColumnExists()
		{
			using (var table = new SqlServerTestTable(Connection, "id int"))
{'fraction_non_alphanumeric': 0.10039630118890357, 'fraction_numerical': 0.0017613386173491853, 'mean_word_length': 5.990769230769231, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5327640', 'n_tokens_mistral': 745, 'n_tokens_neox': 669, 'n_words': 131}