public void DependencyCheckWithValidDependencies()
        {
            IFullNodeBuilder builder = new FullNodeBuilder().UseNodeSettings(NodeSettings.Default(KnownNetworks.StratisRegTest));

            builder.ConfigureFeature(features =>
            {
                features
                .AddFeature <FeatureB>();
            });

            builder.ConfigureFeature(features =>
            {
                features
                .AddFeature <FeatureA>()
                .DependOn <FeatureB>();
            });

            builder.Build();
        }
Example #2
0
        public void DependencyCheckWithValidDependencies()
        {
            var builder = new FullNodeBuilder().UseNodeSettings(NodeSettings.Default());

            builder.ConfigureFeature(features =>
            {
                features
                .AddFeature <FeatureB>();
            });

            builder.ConfigureFeature(features =>
            {
                features
                .AddFeature <FeatureA>()
                .DependOn <FeatureB>();
            });

            builder.Build();
        }
        public void DependencyCheckWithValidDependencies()
        {
            var settings = NodeSettings.Default(KnownNetworks.StratisRegTest);

            IFullNodeBuilder builder = new FullNodeBuilder()
                                       .UsePersistenceProviderMananger(new TestPersistenceProviderManager(settings))
                                       .UseNodeSettings(settings);

            builder.ConfigureFeature(features =>
            {
                features
                .AddFeature <FeatureB>();
            });

            builder.ConfigureFeature(features =>
            {
                features
                .AddFeature <FeatureA>()
                .DependOn <FeatureBase>();
            });

            builder.UsePosConsensus().Build();
        }
        public void DependencyCheckWithInvalidDependenciesThrowsException()
        {
            IFullNodeBuilder builder = new FullNodeBuilder().UseNodeSettings(NodeSettings.Default(KnownNetworks.StratisRegTest));

            builder.ConfigureFeature(features =>
            {
                features
                .AddFeature <FeatureA>()
                .DependOn <FeatureB>();
            });

            Assert.Throws <MissingDependencyException>(() =>
            {
                builder.Build();
            });
        }
        public void DependencyCheckWithInvalidDependenciesThrowsException()
        {
            var nodeSettings = NodeSettings.Default(KnownNetworks.StratisRegTest);

            IFullNodeBuilder builder = new FullNodeBuilder()
                                       .UsePersistenceProviderMananger(new TestPersistenceProviderManager(nodeSettings))
                                       .UseNodeSettings(nodeSettings);

            builder.ConfigureFeature(features =>
            {
                features
                .AddFeature <FeatureA>()
                .DependOn <FeatureB>();
            });

            Assert.Throws <MissingDependencyException>(() =>
            {
                builder.Build();
            });
        }