예제 #1
0
 public void TearDownTest()
 {
     if (Directory.Exists(FileOnDisk.GetDirectoryPath() + @"\Queries"))
     {
         Directory.Delete(FileOnDisk.GetDirectoryPath() + @"\Queries", true);
     }
     if (Directory.Exists(FileOnDisk.GetDirectoryPath() + @"\Expect"))
     {
         Directory.Delete(FileOnDisk.GetDirectoryPath() + @"\Expect", true);
     }
 }
예제 #2
0
        public void Execute_ExistingType_GetTypeForStaticUsage()
        {
            //Build the SUT
            var am = new AssemblyManager();

            //Call the method to test
            var actual = am.GetStatic(FileOnDisk.GetDirectoryPath() + "NBi.Testing.Core.dll", "NBi.Testing.Core.Assemblies.Resource.StaticKlass");

            //Assertion
            Assert.That(actual.FullName, Is.EqualTo("NBi.Testing.Core.Assemblies.Resource.StaticKlass"));
        }
예제 #3
0
        public void GetInstance_ExistingTypeConstructoreWithZeroParam_InstantiatedAndNotNull()
        {
            //Build the SUT
            var am = new AssemblyManager();

            //Call the method to test
            var actual = am.GetInstance(FileOnDisk.GetDirectoryPath() + "NBi.Testing.Core.dll", "NBi.Testing.Core.Assemblies.Resource.Klass", null);

            //Assertion
            Assert.IsInstanceOf <NBi.Testing.Core.Assemblies.Resource.Klass>(actual);
            Assert.That(actual, Is.Not.Null);
        }
예제 #4
0
        private IDecorationCommandArgs GetCommandArgsMock(Type type)
        {
            switch (type)
            {
            case Type x when x == typeof(IBatchRunCommandArgs): return(Mock.Of <IBatchRunCommandArgs>(m => m.ConnectionString == ConnectionStringReader.GetSqlClient()));

            case Type x when x == typeof(ILoadCommandArgs): return(Mock.Of <ILoadCommandArgs>(m => m.ConnectionString == ConnectionStringReader.GetSqlClient()));

            case Type x when x == typeof(IResetCommandArgs): return(Mock.Of <IResetCommandArgs>(m => m.ConnectionString == ConnectionStringReader.GetSqlClient()));

            case Type x when x == typeof(IEtlRunCommandArgs): return(Mock.Of <IEtlRunCommandArgs>());

            case Type x when x == typeof(IConnectionWaitCommandArgs): return(Mock.Of <IConnectionWaitCommandArgs>());

            case Type x when x == typeof(IDeleteCommandArgs): return(Mock.Of <IDeleteCommandArgs>());

            case Type x when x == typeof(IDeletePatternCommandArgs): return(Mock.Of <IDeletePatternCommandArgs>());

            case Type x when x == typeof(IDeleteExtensionCommandArgs): return(Mock.Of <IDeleteExtensionCommandArgs>());

            case Type x when x == typeof(ICopyCommandArgs): return(Mock.Of <ICopyCommandArgs>());

            case Type x when x == typeof(ICopyPatternCommandArgs): return(Mock.Of <ICopyPatternCommandArgs>());

            case Type x when x == typeof(ICopyExtensionCommandArgs): return(Mock.Of <ICopyExtensionCommandArgs>());

            case Type x when x == typeof(IKillCommandArgs): return(Mock.Of <IKillCommandArgs>());

            case Type x when x == typeof(IRunCommandArgs): return(Mock.Of <IRunCommandArgs>());

            case Type x when x == typeof(IStartCommandArgs): return(Mock.Of <IStartCommandArgs>());

            case Type x when x == typeof(IStopCommandArgs): return(Mock.Of <IStopCommandArgs>());

            case Type x when x == typeof(IWaitCommandArgs): return(Mock.Of <IWaitCommandArgs>());

            case Type x when x == typeof(IParallelCommandArgs): return(Mock.Of <IParallelCommandArgs>());

            case Type x when x == typeof(ISequentialCommandArgs): return(Mock.Of <ISequentialCommandArgs>());

            case Type x when x == typeof(ICustomCommandArgs): return(Mock.Of <ICustomCommandArgs>
                                                                     (
                                                                         y => y.AssemblyPath == new LiteralScalarResolver <string>($@"{FileOnDisk.GetDirectoryPath()}\NBi.Testing.Core.dll") &&
                                                                         y.TypeName == new LiteralScalarResolver <string>("NBi.Testing.Core.Resources.CustomCommand")
                                                                     ));

            default: throw new ArgumentOutOfRangeException();
            }
        }
예제 #5
0
        private IDecorationConditionArgs GetConditionArgsMock(Type type)
        {
            switch (type)
            {
            case Type x when x == typeof(IRunningConditionArgs): return(Mock.Of <IRunningConditionArgs>());

            case Type x when x == typeof(FolderExistsConditionArgs): return(new FolderExistsConditionArgs(string.Empty, null, null, null));

            case Type x when x == typeof(FileExistsConditionArgs): return(new FileExistsConditionArgs(string.Empty, null, null, null));

            case Type x when x == typeof(ICustomConditionArgs): return(Mock.Of <ICustomConditionArgs>
                                                                       (
                                                                           y => y.AssemblyPath == new LiteralScalarResolver <string>($@"{FileOnDisk.GetDirectoryPath()}\NBi.Testing.Core.dll") &&
                                                                           y.TypeName == new LiteralScalarResolver <string>("NBi.Testing.Core.Resources.CustomConditionTrue")
                                                                       ));

            default: throw new ArgumentOutOfRangeException();
            }
        }