상속: IComponentFactory
        public void ReturnsComponent()
        {
            // Arrange
            var identity = new ComponentIdentity("hello");
            var hostableComponent = new Mock<IHostableComponent>();
            _dependencyResolver.Setup(x => x.Resolve<IHostableComponent>("hello")).Returns(hostableComponent.Object);
            var factory = new ComponentFactory(_dependencyResolver.Object);

            // Act
            IHostableComponent result = factory.Create(identity);

            // Asssert
            Assert.AreSame(hostableComponent.Object, result);
        }
        public void UnregisteredThrowsException()
        {
            // Arrange
            var identity = new ComponentIdentity("hellonotfound");
            var hostableComponent = new Mock<IHostableComponent>();
            _dependencyResolver.Setup(x => x.Resolve<IHostableComponent>("hellonotfound")).Throws<Exception>();
            var factory = new ComponentFactory(_dependencyResolver.Object);

            // Act
            IHostableComponent result = factory.Create(identity);

            // Assert
            Assert.IsNull(result);
        }
 public void Construct()
 {
     var factory = new ComponentFactory(_dependencyResolver.Object);
     Assert.IsNotNull(factory);
 }