<commit_before>﻿using Cake.EntityFramework.Interfaces;
using Cake.EntityFramework.Migrator;
using Cake.EntityFramework.Tests.Fixtures;
using FluentAssertions;
using System.Linq;
using Xunit;
using Xunit.Abstractions;

namespace Cake.EntityFramework.Tests.Migrator.SqlServer
{
    //[Collection(Traits.SqlServerCollection)]
    public class RemoteMigrationsFacts
    {
        private readonly ITestOutputHelper _logHelper;

        // ReSharper disable once PrivateFieldCanBeConvertedToLocalVariable
        private readonly ILogger _mockLogger;

        private readonly IEfMigrator _migrator;

        public RemoteMigrationsFacts(ITestOutputHelper logHelper)//, SqlServerFixture sqlServerFixture)
        {
            _logHelper = logHelper;
            _mockLogger = new MockLogger(logHelper);
            _migrator = new EfMigrator(SqlServerFactConstants.DdlPath, SqlServerFactConstants.ConfigName, SqlServerFactConstants.AppConfig,
                SqlServerFactConstants.InstanceConnectionString, SqlServerFactConstants.ConnectionProvider, _mockLogger, false);
            //_SqlServerFixture = sqlServerFixture;
        }

        [Fact]
        public void When_no_remote_migration_remote_migrations_should_be_zero()
        {
            var migrations = _migrator.GetRemoteMigrations();
            migrations.Should().HaveCount(7);
        }

        [Fact]
        public void When_no_remote_migrations_current_migration_should_return_not_empty_or_null()
        {
            var migrations = _migrator.GetCurrentMigration();
            migrations.Should().NotBeNullOrEmpty();
        }

        [Fact]
        public void When_single_remote_migration_current_migration_should_return_single_migration()
        {<commit_msg>Fix Tests<commit_after>﻿using Cake.EntityFramework.Interfaces;
using Cake.EntityFramework.Migrator;
using Cake.EntityFramework.Tests.Fixtures;
using FluentAssertions;
using System.Linq;
using Xunit;
using Xunit.Abstractions;

namespace Cake.EntityFramework.Tests.Migrator.SqlServer
{
    //[Collection(Traits.SqlServerCollection)]
    public class RemoteMigrationsFacts
    {
        private readonly ITestOutputHelper _logHelper;

        // ReSharper disable once PrivateFieldCanBeConvertedToLocalVariable
        private readonly ILogger _mockLogger;

        private readonly IEfMigrator _migrator;

        public RemoteMigrationsFacts(ITestOutputHelper logHelper)//, SqlServerFixture sqlServerFixture)
        {
            _logHelper = logHelper;
            _mockLogger = new MockLogger(logHelper);
            _migrator = new EfMigrator(SqlServerFactConstants.DdlPath, SqlServerFactConstants.ConfigName, SqlServerFactConstants.AppConfig,
                SqlServerFactConstants.InstanceConnectionString, SqlServerFactConstants.ConnectionProvider, _mockLogger, false);
            //_SqlServerFixture = sqlServerFixture;
        }

        [Fact]
        public void When_no_remote_migration_remote_migrations_should_be_zero()
        {
            var migrations = _migrator.GetRemoteMigrations();
            migrations.Should().HaveCount(0);
        }

        //[Fact]
        //public void When_no_remote_migrations_current_migration_should_return_not_empty_or_null()
        //{
        //    var migrations = _migrator.GetCurrentMigration();
        //    migrations.Should().NotBeNullOrEmpty();
        //}

        [Fact]
        public void When_single_remote_migration_current_migration_should_return_single_migration()
        {
{'fraction_non_alphanumeric': 0.06769936890418818, 'fraction_numerical': 0.0005737234652897303, 'mean_word_length': 3.2837837837837838, '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': '5529729', 'n_tokens_mistral': 952, 'n_tokens_neox': 959, 'n_words': 155}