AccidentalFish.ApplicationSupport.Core.Tests.Unit.Runtime.Implementation.ComponentFactoryTests.UnregisteredThrowsException C# (CSharp) Метод

UnregisteredThrowsException() приватный Метод

private UnregisteredThrowsException ( ) : void
Результат void
        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);
        }
    }