public void GetTypes_WithTypeDiscoveryService_NotIncludeGac()
        {
            Expect.Call(_serviceProvider.GetService(typeof(ITypeDiscoveryService))).Return(_typeDiscoveryService);
            Expect.Call(_typeDiscoveryService.GetTypes(typeof(object), true))
            .Return(
                new object[]
            {
                typeof(ClassWithAllDataTypes),
                typeof(SimpleValueType),
                typeof(SimpleReferenceType),
                typeof(ManualBusinessObject),
                typeof(ClassDerivedFromBindableObjectBase),
                typeof(ClassDerivedFromBindableObjectWithIdentityBase),
            });

            _mockRepository.ReplayAll();

            var         finder = new BindableObjectTypeFinder(_serviceProvider);
            List <Type> types  = finder.GetTypes(false);

            Assert.That(types, Is.EquivalentTo(new[]
            {
                typeof(ClassWithAllDataTypes),
                typeof(ClassDerivedFromBindableObjectBase),
                typeof(ClassDerivedFromBindableObjectWithIdentityBase),
            }));

            _mockRepository.VerifyAll();
        }
        public void GetTypes_WithoutTypeDiscoveryService()
        {
            Expect.Call(_serviceProvider.GetService(typeof(ITypeDiscoveryService))).Return(null);

            _mockRepository.ReplayAll();

            var         finder = new BindableObjectTypeFinder(_serviceProvider);
            List <Type> types  = finder.GetTypes(false);

            Assert.That(types, Is.Empty);

            _mockRepository.VerifyAll();
        }
        public void GetTypes_WithTypeDiscoveryService_GetsTypeInheritingMixinFromBase()
        {
            Expect.Call(_serviceProvider.GetService(typeof(ITypeDiscoveryService))).Return(_typeDiscoveryService);
            Expect.Call(_typeDiscoveryService.GetTypes(typeof(object), true))
            .Return(
                new object[]
            {
                typeof(DerivedBusinessObjectClassWithoutAttribute)
            });

            _mockRepository.ReplayAll();

            var         finder = new BindableObjectTypeFinder(_serviceProvider);
            List <Type> types  = finder.GetTypes(false);

            Assert.That(types, Is.EquivalentTo(new[] { typeof(DerivedBusinessObjectClassWithoutAttribute) }));

            _mockRepository.VerifyAll();
        }