public SingleInterfaceBindingGeneratorTests()
 {
     this.kernelMock = new KernelMock();
     this.bindableInterfaceSelectorMock = new Mock<IBindableTypeSelector>();
     var bindingGeneratorFactory = new BindingGeneratorFactory(this.bindableInterfaceSelectorMock.Object);
     this.testee = bindingGeneratorFactory.CreateSingleInterfaceBindingGenerator();
 }
 public AllInterfacesBindingGeneratorTests()
 {
     this.kernel = new Mock<IKernel>().Object;
     this.bindableInterfaceSelectorMock = new Mock<IBindableTypeSelector>();
     this.multiBindingCreatorMock = new Mock<IBindingCreator>();
     this.testee = new AllInterfacesBindingGenerator(this.bindableInterfaceSelectorMock.Object, this.multiBindingCreatorMock.Object);
 }
        public BaseBindingGeneratorTests()
        {
            this.kernelMock = new KernelMock();
            var bindingGeneratorFactory = new BindingGeneratorFactory(null);

            this.testee = bindingGeneratorFactory.CreateBaseBindingGenerator();
        }
예제 #4
0
 public AllInterfacesBindingGeneratorTests()
 {
     this.kernel = new Mock <IKernel>().Object;
     this.bindableInterfaceSelectorMock = new Mock <IBindableTypeSelector>();
     this.multiBindingCreatorMock       = new Mock <IBindingCreator>();
     this.testee = new AllInterfacesBindingGenerator(this.bindableInterfaceSelectorMock.Object, this.multiBindingCreatorMock.Object);
 }
        public SingleInterfaceBindingGeneratorTests()
        {
            this.kernelMock = new KernelMock();
            this.bindableInterfaceSelectorMock = new Mock <IBindableTypeSelector>();
            var bindingGeneratorFactory = new BindingGeneratorFactory(this.bindableInterfaceSelectorMock.Object);

            this.testee = bindingGeneratorFactory.CreateSingleInterfaceBindingGenerator();
        }
 public DefaultInterfacesBindingGeneratorTests()
 {
     this.kernelMock = new KernelMock();
     this.bindableInterfaceSelectorMock = new Mock<IBindableTypeSelector>();
     this.multiBindingCreatorMock = new Mock<IBindingCreator>();
     var bindingGeneratorFactory = new TestBindingGeneratorFactory(
         this.bindableInterfaceSelectorMock.Object,
         this.multiBindingCreatorMock.Object);
     this.testee = bindingGeneratorFactory.CreateDefaultInterfacesBindingGenerator();
 }
예제 #7
0
        public DefaultInterfaceBindingGeneratorTests()
        {
            this.kernelMock = new KernelMock();
            this.bindableInterfaceSelectorMock = new Mock <IBindableTypeSelector>();
            this.multiBindingCreatorMock       = new Mock <IBindingCreator>();
            var bindingGeneratorFactory = new TestBindingGeneratorFactory(
                this.bindableInterfaceSelectorMock.Object,
                this.multiBindingCreatorMock.Object);

            this.testee = bindingGeneratorFactory.CreateDefaultInterfaceBindingGenerator();
        }
예제 #8
0
        /// <summary>
        /// Creates the bindings using the specified generator.
        /// </summary>
        /// <param name="generator">The generator to use to create the bindings.</param>
        public void BindWith(IBindingGenerator generator)
        {
            if (generator == null)
            {
                throw new ArgumentNullException("generator");
            }

            this.CreateTypeList();

            foreach (var type in this.types)
            {
                this.bindingSyntax[type] = generator.CreateBindings(type, this.bindingRoot).ToList();
            }
        }
예제 #9
0
 /// <summary>
 /// Bind using a custom binding generator.
 /// </summary>
 /// <param name="generator">The generator used to create the bindings.</param>
 /// <returns>The fluent syntax</returns>
 public IConfigureSyntax BindWith(IBindingGenerator generator)
 {
     this.bindingBuilder.BindWith(generator);
     return(this);
 }
 public BaseBindingGeneratorTests()
 {
     this.kernelMock = new KernelMock();
     var bindingGeneratorFactory = new BindingGeneratorFactory(null);
     this.testee = bindingGeneratorFactory.CreateBaseBindingGenerator();
 }
 public CountingInterfaceBindingGenerator()
 {
     this.innerBindingGenerator =
         new AllInterfacesBindingGenerator(new BindableTypeSelector(), new SingleConfigurationBindingCreator());
 }