public void ContainerShouldCreateInstance() { Container container = new HashContainer(); string t = "Ola"; A resolved = (A) container.InstanceFrom(typeof(A), new string[] { t }); Assert.AreEqual(t, resolved.a); }
public void ContainerShouldRevolveTypes() { Container container = new HashContainer(); container.Register(typeof(Container), typeof(HashContainer)); object resolved = container.InstanceFrom(typeof(Container)); Assert.IsInstanceOf(typeof(HashContainer), resolved); }
public Interfaces.Contexts.Context CreateContext() { Builder builder = new UnityBuilder(); Container container = new HashContainer(); Context ctx = new UnityContext(builder, container); return ctx; }
private Context defaultContext() { Builder builder = new UnityBuilder(); Container container = new HashContainer(); container.Register(typeof(Log), typeof(LogTest)); Context context = new UnityContext(builder, container); return context; }