public void When_getting_an_assembly_by_type()
        {
            _hostAssembly.AllTypes.Returns(AllEndpoints);
            _endpointConvention.IsMatch(Arg.Any <Type>()).Returns(true);

            var es = new EndpointAssemblyScanner(_hostAssembly, _endpointConvention);

            es.GetEndpointByType(typeof(PrivateEndpoint)).Type.ShouldEqual(typeof(PrivateEndpoint));
        }
        public void When_listing_all_endpoints_and_none_match_the_convention()
        {
            _hostAssembly.AllTypes.Returns(AllEndpoints);
            _endpointConvention.IsMatch(Arg.Any <Type>()).Returns(false);

            var es = new EndpointAssemblyScanner(_hostAssembly, _endpointConvention);

            es.GetEndpoints().ShouldBeEmpty();
        }
        public void When_listing_all_endpoints_and_there_are_no_types()
        {
            _hostAssembly.AllTypes.Returns(new Type[] { });
            _endpointConvention.IsMatch(Arg.Any <Type>()).Returns(true);

            var es = new EndpointAssemblyScanner(_hostAssembly, _endpointConvention);

            es.GetEndpoints().ShouldBeEmpty();
        }
        public void When_listing_all_endpoints_and_one_matches_the_convention()
        {
            _hostAssembly.AllTypes.Returns(AllEndpoints);
            _endpointConvention.IsMatch(Arg.Any <Type>()).Returns(false);
            _endpointConvention.IsMatch(typeof(PrivateEndpoint)).Returns(true);

            var es = new EndpointAssemblyScanner(_hostAssembly, _endpointConvention);

            es.GetEndpoints().Single().Name.ShouldEqual("Private");
        }