public void Resolve_WithAbritraryParameters_ReturnsResultCorrectly() { Func<ISymbol, Maybe<object>> strategy = _ => "Baz".ToMaybe<object>(); var resolver = new DependencyResolver(strategy); var result = resolver.Resolve(typeof (IDisposable), "Foo"); Assert.AreEqual("Baz", result); }
public void Resolve_WithAbritraryParameters_CallsResolutionStrategyCorrectly() { string name = null; Type dependencyType = null; Func<ISymbol, Maybe<object>> strategy = symbol => { name = ((IDependencySymbol) symbol).Name; dependencyType = ((IDependencySymbol) symbol).DependencyType; return Maybe<object>.NoValue; }; var resolver = new DependencyResolver(strategy); resolver.Resolve(typeof(IDisposable), "Foo"); Assert.AreEqual("Foo", name); Assert.AreEqual(typeof(IDisposable), dependencyType); }
public static object Resolve(ISymbol symbol) { return(DependencyResolver.Resolve(symbol)); }
public static object Resolve(Type dependencyType, string name) { return(DependencyResolver.Resolve(dependencyType, name)); }
public static T Resolve <T>(ISymbol <T> symbol) { return(DependencyResolver.Resolve(symbol)); }
public static T Resolve <T>(string name) { return(DependencyResolver.Resolve <T>(name)); }
public static T Resolve <T>() { return(DependencyResolver.Resolve <T>()); }