コード例 #1
0
        public void Plugin_PluginTypes_AlreadySet_Test()
        {
            // Arrange
            var plugin = CreatePlugin(true);

            plugin.PluginTypes = new List <Type>();

            // Act
            var types = plugin.PluginTypes;

            // Assert
            IEnumerableAssert.IsNullOrEmpty(types, "Empty");
            _MockRepository.VerifyAll();
        }
コード例 #2
0
        public void Plugin_GetPluginTypes_NullOrEmptyTypesReturned_Test(List <Type> list, string testTitle)
        {
            // Arrange
            var plugin = CreatePlugin(true);

            _MockPluginDependencyResolver.Setup(m => m.AddDependencyResolver());
            var mockAssembly = _MockRepository.Create <IAssembly>();

            plugin.Assembly = mockAssembly.Object;
            _MockTypeLoader.Setup(m => m.Load(mockAssembly.Object)).Returns(list);
            _MockPluginDependencyResolver.Setup(m => m.RemoveDependencyResolver());
            _MockPluginDependencyResolver.Setup(m => m.Plugin).Returns(plugin);

            // Act
            var types = plugin.GetPluginTypes();

            // Assert
            IEnumerableAssert.IsNullOrEmpty(types, testTitle);
            _MockRepository.VerifyAll();
        }