using Microsoft.Extensions.Configuration;
using Siger.CommonUtil;
using Siger.Schedule.QmsModule;
using System;
using System.IO;
using Xunit;

namespace Siger.UnitTest
{
    public class QmsUnitTest
    {
        static QmsUnitTest()
        {
            IConfiguration config = new ConfigurationBuilder()
                .AddJsonFile(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, @"appsettings.json"))
                .Build();
            ConfigFactory.InitConfigByContent(config);
        }

        [Fact]
        public void QmsCreateTraceTableJobScheduleTest()
        {
            QmsCreateTraceTableJobSchedule migrationJobSchedule = new QmsCreateTraceTableJobSchedule();
            migrationJobSchedule.PreInit(null);
            migrationJobSchedule.Execute(null);
            migrationJobSchedule.AfterExecute(null);
        }

        [Fact]
        public void QmsDataMigrationJobTest()
        {
            QmsDataMigrationJobSchedule migrationJobSchedule = new QmsDataMigrationJobSchedule();
            migrationJobSchedule.PreInit(null);
            migrationJobSchedule.Execute(null);
            migrationJobSchedule.AfterExecute(null);
        }

        [Fact]
        public void QmsParameterConfigJobScheduleTest()
        {
            QmsParameterConfigJobSchedule configJobSchedule = new QmsParameterConfigJobSchedule();
            configJobSchedule.PreInit(null);
            configJobSchedule.Execute(null);
            configJobSchedule.AfterExecute(null);
        }

        [Fact]
        public void QmsSensorJobScheduleTest()
        {
            QmsSensorJobSchedule sensorJobSchedule = new QmsSensorJobSchedule();
            sensorJobSchedule.PreInit(null);
            sensorJobSchedule.Execute(null);
            sensorJobSchedule.AfterExecute(null);
        }
    }
}
