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);
 }
示例#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>();
        }
 public void it_does_not_have_the_factory_should_throw_an_exception()
 {
     created_exception = new Exception();
     missing_dependency_error_handler = x =>
         {
             Assert.AreEqual(x, typeof(IDbConnection));
             return created_exception;
         };
     factories = new DependecyFactories(all_the_factories, missing_dependency_error_handler);
     factories.get_factory_to_create(typeof (IDbConnection));
 }
示例#6
0
 public void it_does_not_have_the_factory_should_throw_an_exception()
 {
     created_exception = new Exception();
     missing_dependency_error_handler = x =>
     {
         Assert.AreEqual(x, typeof(IDbConnection));
         return(created_exception);
     };
     factories = new DependecyFactories(all_the_factories, missing_dependency_error_handler);
     factories.get_factory_to_create(typeof(IDbConnection));
 }
 public DependencyContainer(IFindAFactoryForADependency factories, ICreateErrorsFromFactoryContainerErrors creation_error_factory)
 {
     this.factories = factories;
     this.creation_error_factory = creation_error_factory;
 }