Пример #1
0
        public void PluginRuntimeHandler_FetchNamespaceListObject_WhenNullDll_ExpectException()
        {
            //------------Setup for test--------------------------
            var pluginRuntimeHandler = new PluginRuntimeHandler();

            //------------Execute Test---------------------------
            pluginRuntimeHandler.FetchNamespaceListObject(null);
        }
Пример #2
0
        public void PluginRuntimeHandler_FetchNamespaceListObject_WhenNullLocationAndInvalidSourceID_ExpectException()
        {
            //------------Setup for test--------------------------
            var pluginRuntimeHandler = new PluginRuntimeHandler();
            var source = CreatePluginSource(true);

            //------------Execute Test---------------------------
            pluginRuntimeHandler.FetchNamespaceListObject(source);
        }
Пример #3
0
        public void PluginRuntimeHandler_FetchNamespaceListObject_WhenValidDll_ExpectNamespaces()
        {
            //------------Setup for test--------------------------
            var pluginRuntimeHandler = new PluginRuntimeHandler();
            var source = CreatePluginSource();

            //------------Execute Test---------------------------
            var result = pluginRuntimeHandler.FetchNamespaceListObject(source);

            //------------Assert Results-------------------------
            Assert.IsTrue(result.Count > 0);
        }
Пример #4
0
        public void FetchNamespaceListObject_GivenThrowsBadFormatExceptionError_ShouldRethrowBadFormatException()
        {
            //---------------Set up test pack-------------------
            var source = CreatePluginSource(typeof(DummyClassForPluginTest));
            //---------------Assert Precondition----------------
            //---------------Execute Test ----------------------
            var      mockAssemblyLoader = new Mock <IAssemblyLoader>();
            Assembly assembly;

            mockAssemblyLoader.Setup(loader => loader.TryLoadAssembly(It.IsAny <string>(), It.IsAny <string>(), out assembly))
            .Throws(new BadImageFormatException());
            var pluginRuntimeHandler = new PluginRuntimeHandler(mockAssemblyLoader.Object);

            //---------------Test Result -----------------------
            pluginRuntimeHandler.FetchNamespaceListObject(source);
        }