예제 #1
0
 public void TestBasicInjection()
 {
     var injectionRegistry = new InjectionRegistry();
     var container = new Container(injectionRegistry);
     var instance = container.GetInstance<ISynchronousParameterizedCommand<DummyParameter, DummyResult>>();
     var dummyParameter = new DummyParameter();
     var result = instance.Execute(dummyParameter);
     Check.That(instance).IsNotNull();
 }
예제 #2
0
 public OtherData(ParameterType typeId, string n)
 {
     TypeId  = typeId;
     Name    = n;
     Factory = (name, id, defaultValue, document) =>
     {
         Assert.That(LastGeneratorParameters, Is.EqualTo(null));
         LastGeneratorParameters              = new LastGeneratorParametersType();
         LastGeneratorParameters.name         = name;
         LastGeneratorParameters.id           = id;
         LastGeneratorParameters.defaultValue = defaultValue;
         LastGeneratorParameters.document     = document;
         var createdParameter = new DummyParameter(typeId, name, id, defaultValue);
         LastGeneratorParameters.createdParameter = createdParameter;
         return(createdParameter);
     };
 }