public void CanRegisterSetOfFilteredTypes_AsServiceType() { var catalog = new TypeCatalog(new ServiceCollection(), typeof(ComponentOne), typeof(ComponentTwo)); catalog.AsSelf( t => t.Name.StartsWith("Component", System.StringComparison.Ordinal), ServiceLifetime.Scoped); Assert.Equal(2, catalog.Services.Count); Assert.True(catalog.Services.All(s => s.Lifetime == ServiceLifetime.Scoped)); Assert.Contains(catalog.Services, s => s.ServiceType == typeof(ComponentOne) && s.ImplementationType == typeof(ComponentOne)); Assert.Contains(catalog.Services, s => s.ServiceType == typeof(ComponentTwo) && s.ImplementationType == typeof(ComponentTwo)); }