public void it_has_the_factory_should_return_the_factory()
 {
     all_the_factories[typeof (IStub)] = factory;
     factories = new DependecyFactories(all_the_factories, missing_dependency_error_handler);
     result = factories.get_factory_to_create(typeof (IStub));
     Assert.AreEqual(result, factory);
 }
Ejemplo n.º 2
0
 public void it_has_the_factory_should_return_the_factory()
 {
     all_the_factories[typeof(IStub)] = factory;
     factories = new DependecyFactories(all_the_factories, missing_dependency_error_handler);
     result    = factories.get_factory_to_create(typeof(IStub));
     Assert.AreEqual(result, factory);
 }
        public void setup()
        {
            the_connection = MockRepository.GenerateMock <IDbConnection>();
            factories      = MockRepository.GenerateMock <IFindAFactoryForADependency>();
            the_factory_that_can_create_the_dependency = MockRepository.GenerateMock <ICreateOneDependency>();

            factories.Stub(x => x.get_factory_to_create(typeof(IDbConnection))).Return(the_factory_that_can_create_the_dependency);
            error_handler = MockRepository.GenerateMock <ICreateErrorsFromFactoryContainerErrors>();
        }
        public void setup()
        {
            the_connection = MockRepository.GenerateMock<IDbConnection>();
            factories = MockRepository.GenerateMock<IFindAFactoryForADependency>();
            the_factory_that_can_create_the_dependency = MockRepository.GenerateMock<ICreateOneDependency>();

            factories.Stub(x => x.get_factory_to_create(typeof(IDbConnection))).Return(the_factory_that_can_create_the_dependency);
            error_handler = MockRepository.GenerateMock<ICreateErrorsFromFactoryContainerErrors>();
        }
Ejemplo n.º 5
0
 static void register_factory <contract>(ICreateOneDependency factory)
 {
     all_factories[typeof(contract)] = factory;
 }
 public void setup()
 {
     factory = MockRepository.GenerateMock<ICreateOneDependency>();
     missing_dependency_error_handler = MockRepository.GenerateMock<ICreateTheExceptionForAMissingDependencyFactory>();
     all_the_factories = new Dictionary<Type, ICreateOneDependency>();
 }
 public DependencyFactory(TypeMatchCriteria criteria, ICreateOneDependency real_factory)
 {
   this.criteria = criteria;
   this.real_factory = real_factory;
 }
Ejemplo n.º 8
0
 public void setup()
 {
     factory = MockRepository.GenerateMock <ICreateOneDependency>();
     missing_dependency_error_handler = MockRepository.GenerateMock <ICreateTheExceptionForAMissingDependencyFactory>();
     all_the_factories = new Dictionary <Type, ICreateOneDependency>();
 }