示例#1
0
        public void AreDependenciesRegistered()
        {
            PushToBlobFeed task = new PushToBlobFeed();

            var collection = new ServiceCollection();

            task.ConfigureServices(collection);
            var provider = collection.BuildServiceProvider();

            foreach (var dependency in task.GetExecuteParameterTypes())
            {
                var service = provider.GetRequiredService(dependency);
                service.Should().NotBeNull();
            }

            DependencyInjectionValidation.IsDependencyResolutionCoherent(
                s =>
            {
                task.ConfigureServices(s);
            },
                out string message
                )
            .Should()
            .BeTrue(message);
        }
示例#2
0
        public void AreDependenciesRegistered()
        {
            PushToBlobFeed task = new PushToBlobFeed();

            var collection = new ServiceCollection();

            task.ConfigureServices(collection);
            var provider = collection.BuildServiceProvider();

            DependencyInjectionValidation.IsDependencyResolutionCoherent(
                s =>
            {
                task.ConfigureServices(s);
            },
                out string message,
                additionalSingletonTypes: task.GetExecuteParameterTypes()
                )
            .Should()
            .BeTrue(message);
        }