public void GetTypes_should_return_distinct_types()
        {
            var scanner =
                new AggregatedTypeScanner();

            scanner.Add(new TypeScanner(new[] { typeof(string) }));
            scanner.Add(new TypeScanner(new[] { typeof(string) }));

            var results =
                scanner.GetTypes(x => true);

            results.Count().ShouldEqual(1);
        }
        public void GetTypes_should_return_distinct_types()
        {
            var scanner =
                new AggregatedTypeScanner();

            scanner.Add(new TypeScanner(new[] { typeof(string) }));
            scanner.Add(new TypeScanner(new[] { typeof(string) }));

            var results =
                scanner.GetTypes(x => true);

            results.Count().ShouldEqual(1);
        }
        public void Add_should_throw_argumentnullexception_when_called_with_null()
        {
            var scanner =
                new AggregatedTypeScanner();

            var exception =
                Catch.Exception(() => scanner.Add(null));

            exception.ShouldBeOfType <ArgumentNullException>();
        }
        public void Add_should_add_type_scanner_to_collection_of_scanners_that_are_queried_by_gettypes()
        {
            var scanner =
                new AggregatedTypeScanner();

            var mockScanner =
                new Mock <ITypeScanner>();

            mockScanner.Setup(x => x.GetTypes(It.IsAny <Predicate <Type> >())).Verifiable();

            scanner.Add(mockScanner.Object);

            var results =
                scanner.GetTypes(p => true);

            mockScanner.Verify();
        }
        public void Add_should_throw_argumentnullexception_when_called_with_null()
        {
            var scanner =
                new AggregatedTypeScanner();

            var exception =
                Catch.Exception(() => scanner.Add(null));

            exception.ShouldBeOfType<ArgumentNullException>();
        }
        public void Add_should_add_type_scanner_to_collection_of_scanners_that_are_queried_by_gettypes()
        {
            var scanner =
                new AggregatedTypeScanner();

            var mockScanner =
                new Mock<ITypeScanner>();
            mockScanner.Setup(x => x.GetTypes(It.IsAny<Predicate<Type>>())).Verifiable();

            scanner.Add(mockScanner.Object);

            var results =
                scanner.GetTypes(p => true);

            mockScanner.Verify();
        }