public EndpointAssemblyScanner(IHostAssembly hostAssembly, IEndpointConvention namingConvention)
 {
     _namingConvention = namingConvention;
     _types            = new Lazy <List <Endpoint> >(() => hostAssembly
                                                     .AllTypes
                                                     .Where(t => _namingConvention.IsMatch(t))
                                                     .Select(t => new Endpoint(t, _namingConvention.GetName(t)))
                                                     .ToList());
 }
        public EndpointAssemblyScannerTests()
        {
            _hostAssembly       = Substitute.For <IHostAssembly>();
            _endpointConvention = Substitute.For <IEndpointConvention>();

            _endpointConvention
            .GetName(Arg.Any <Type>())
            .Returns(call => call.Arg <Type>().Name.Replace("Endpoint", ""));
        }