Exemplo n.º 1
0
        public void Execute_ExistingType_GetTypeForStaticUsage()
        {
            //Build the SUT
            var am = new AssemblyManager();

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

            //Assertion
            Assert.That(actual.FullName,Is.EqualTo("NBi.Testing.Unit.Core.Assemblies.Resource.StaticKlass"));
        }
Exemplo n.º 2
0
        public void Execute_ExistingTypeConstructoreWithZeroParam_PublicMethodOneParameter()
        {
            //Build the SUT
            var am = new AssemblyManager();
            var klass = new NBi.Testing.Unit.Core.Assemblies.Resource.Klass();
            var paramDico = new Dictionary<string, object>();
            paramDico.Add("paramString", "MyString");

            //Call the method to test
            var actual = am.Execute(klass, "ExecutePublicString", paramDico);

            //Assertion
            Assert.That(actual, Is.EqualTo("Executed"));
        }
Exemplo n.º 3
0
        public void Execute_ExistingTypeConstructoreWithZeroParam_SeveralParameter()
        {
            //Build the SUT
            var am = new AssemblyManager();
            var klass = new NBi.Testing.Unit.Core.Assemblies.Resource.Klass();
            var paramDico = new Dictionary<string, object>();

            //Reverse param order to ensure they are correctly re-ordered!
            paramDico.Add("paramEnum", "Beta");
            paramDico.Add("paramDateTime", "2012-05-07");

            //Call the method to test
            var actual = am.Execute(klass, "ExecuteDoubleParam", paramDico);

            //Assertion
            Assert.That(actual, Is.EqualTo("Executed"));
        }
Exemplo n.º 4
0
        public void Execute_ExistingType_StaticMethod()
        {
            //Build the SUT
            var am = new AssemblyManager();
            var paramDico = new Dictionary<string, object>();

            //Reverse param order to ensure they are correctly re-ordered!
            paramDico.Add("paramString", "MyString");

            //Call the method to test
            var actual = am.ExecuteStatic(typeof(NBi.Testing.Unit.Core.Assemblies.Resource.StaticKlass), "ExecuteStaticString", paramDico);

            //Assertion
            Assert.That(actual, Is.EqualTo("Executed"));
        }
Exemplo n.º 5
0
        public void GetInstance_ExistingTypeConstructoreWithZeroParam_InstantiatedAndNotNull()
        {
            //Build the SUT
            var am = new AssemblyManager();

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

            //Assertion
            Assert.IsInstanceOf<NBi.Testing.Unit.Core.Assemblies.Resource.Klass>(actual);
            Assert.That(actual, Is.Not.Null);
        }