InstanceFrom() public method

public InstanceFrom ( Type type ) : object
type System.Type
return object
Esempio n. 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);
 }
Esempio n. 2
0
 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);
 }