Example #1
0
        private static List <ServiceDescriptor> ConfigureServices()
        {
            var descriptors = new List <ServiceDescriptor>();
            var services    = Substitute.For <IServiceCollection>();

            services.When(s => s.Add(Arg.Any <ServiceDescriptor>()))
            .Do(args => descriptors.Add(args[0] as ServiceDescriptor));
            var logger = Substitute.For <ILogger>();

            var configure = new Singletons();

            configure.Logger = logger;
            configure.ConfigureServices(services);
            return(descriptors);
        }