예제 #1
0
        public void AutofacDependencyResolver_Should_Register_ReactiveUI_BindingTypeConverters()
        {
            // Invoke RxApp which initializes the ReactiveUI platform.
            var builder = new ContainerBuilder();
            var locator = new AutofacDependencyResolver(builder);

            locator.InitializeReactiveUI();
            var container = builder.Build();

            var converters = container.Resolve <IEnumerable <IBindingTypeConverter> >().ToList();

            converters.Should().NotBeNull();
            converters.Should().Contain(x => x.GetType() == typeof(StringConverter));
            converters.Should().Contain(x => x.GetType() == typeof(EqualityTypeConverter));
        }
예제 #2
0
        public void AutofacDependencyResolver_Should_Register_ReactiveUI_CreatesCommandBinding()
        {
            // Invoke RxApp which initializes the ReactiveUI platform.
            var builder = new ContainerBuilder();
            var locator = new AutofacDependencyResolver(builder);

            locator.InitializeReactiveUI();
            Locator.SetLocator(locator);
            var container = builder.Build();

            var converters = container.Resolve <IEnumerable <ICreatesCommandBinding> >().ToList();

            converters.Should().NotBeNull();
            converters.Should().Contain(x => x.GetType() == typeof(CreatesCommandBindingViaEvent));
            converters.Should().Contain(x => x.GetType() == typeof(CreatesCommandBindingViaCommandParameter));
        }