public void ShouldRegisterAndResolveTransientInstance()
        {
            var componentUnderTest = new WindsorServiceBusResolver();

             componentUnderTest.Register<IContract, Concrete>();

             var resultA = componentUnderTest.Resolve<IContract>();
             var resultB = componentUnderTest.Resolve<IContract>();

             Assert.That(resultB, Is.Not.SameAs(resultA));
        }
        public void ShouldRegisterAndResolveSingletonInstance()
        {
            var componentUnderTest = new WindsorServiceBusResolver();

             var instance = new Concrete();
             componentUnderTest.Register<IContract>(instance);

             var resultA = componentUnderTest.Resolve<IContract>();
             var resultB = componentUnderTest.Resolve<IContract>();

             Assert.That(resultA, Is.SameAs(instance));
             Assert.That(resultB, Is.SameAs(instance));
        }
        public void ShouldResolveFromContainer()
        {
            var componentUnderTest = new WindsorServiceBusResolver(this.windsorContainer);

             componentUnderTest.Resolve<IContract>();

             A.CallTo(() => this.windsorContainer.Resolve<IContract>()).MustHaveHappened(Repeated.Exactly.Once);
        }
        public void ShouldResolveConcreteInstance()
        {
            var componentUnderTest = new WindsorServiceBusResolver();

             componentUnderTest.Register<IContract, Concrete>();

             var result = componentUnderTest.Resolve<IContract>();

             Assert.That(result, Is.InstanceOf<Concrete>());
        }