Пример #1
0
        public IDependency <T> MapType <T>()
        {
            var dependency = new TypeDependency(typeof(T), dependencies);

            var wrapper = new DependencyWrapper <T>(dependency);

            return(wrapper);
        }
Пример #2
0
        public void Resolve_DependencyWrapper()
        {
            var emailDependencyWrapper = new DependencyWrapper <EmailNotification>(_emailNotificationDetails);

            _dependencyContainer.Setup(mock => mock.Resolve <EmailNotification>()).Returns(emailDependencyWrapper.Instance);
            var emailNotification = DependencyContainer.Resolve <EmailNotification>();

            emailNotification.Should().NotBeNull();
            _dependencyContainer.Verify(mock => mock.Resolve <EmailNotification>(), Times.Once);
        }