public void DefaultViewComponentActivatorActivatesNonBuiltInTypes()
        {
            // Arrange
            var activator       = new DefaultViewComponentActivator();
            var helper          = Mock.Of <IHtmlHelper <object> >();
            var myTestService   = new MyService();
            var serviceProvider = new Mock <IServiceProvider>();

            serviceProvider.Setup(p => p.GetService(typeof(IHtmlHelper <object>))).Returns(helper);
            serviceProvider.Setup(p => p.GetService(typeof(MyService))).Returns(myTestService);
            var viewContext = GetViewContext(serviceProvider.Object);
            var instance    = new TestViewComponentWithCustomDataType();

            // Act
            activator.Activate(instance, viewContext);

            // Assert
            Assert.Equal(myTestService, instance.TestMyServiceObject);
        }
        public void DefaultViewComponentActivatorActivatesNonBuiltInTypes()
        {
            // Arrange
            var activator = new DefaultViewComponentActivator();
            var helper = Mock.Of<IHtmlHelper<object>>();
            var myTestService = new MyService();
            var serviceProvider = new Mock<IServiceProvider>();
            serviceProvider.Setup(p => p.GetService(typeof(IHtmlHelper<object>))).Returns(helper);
            serviceProvider.Setup(p => p.GetService(typeof(MyService))).Returns(myTestService);
            serviceProvider.Setup(p => p.GetService(typeof(ICompositeViewEngine))).Returns(Mock.Of<ICompositeViewEngine>());
            serviceProvider.Setup(p => p.GetService(typeof(IUrlHelper))).Returns(Mock.Of<IUrlHelper>());
            var viewContext = GetViewContext(serviceProvider.Object);
            var instance = new TestViewComponentWithCustomDataType();

            // Act
            activator.Activate(instance, viewContext);

            // Assert
            Assert.Equal(myTestService, instance.TestMyServiceObject);

        }