Register() 공개 메소드

public Register ( Type abstractType, Type concreteType ) : void
abstractType System.Type
concreteType System.Type
리턴 void
예제 #1
0
 public void ContainerShouldRevolveTypes()
 {
     Container container = new HashContainer();
     container.Register(typeof(Container), typeof(HashContainer));
     object resolved =  container.InstanceFrom(typeof(Container));
     Assert.IsInstanceOf(typeof(HashContainer), resolved);
 }
예제 #2
0
 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;
 }