Ejemplo n.º 1
0
        // TODO (Cameron): If type is in this library then don't bootstrap.
        private static AggregateRootType CreateAggregateRootType(Type type)
        {
            var typeAnalyzer         = new DefaultTypeAnalyzerService();
            var bootStrapperProvider = new DefaultBootstrapperProvider();

            return(new AggregateRootTypeFactory(typeAnalyzer, bootStrapperProvider).Create(type));
        }
Ejemplo n.º 2
0
        private static ValueObjectType CreateValueObjectType(Type type)
        {
            var typeAnalyzer         = new DefaultTypeAnalyzerService();
            var bootStrapperProvider = new DefaultBootstrapperProvider();

            return(new ValueObjectTypeFactory(typeAnalyzer, bootStrapperProvider).Create(type));
        }
Ejemplo n.º 3
0
        // NOTE (Cameron): Wire-up.
        static Application()
        {
            var typeAnalyzerService  = new DefaultTypeAnalyzerService();
            var bootStrapperProvider = new DefaultBootstrapperProvider();

            DefaultAggregateRootTypeFactory = new AggregateRootTypeFactory(typeAnalyzerService, bootStrapperProvider);
            DefaultEntityTypeFactory        = new EntityTypeFactory(typeAnalyzerService, bootStrapperProvider);
            DefaultValueObjectTypeFactory   = new ValueObjectTypeFactory(typeAnalyzerService, bootStrapperProvider);
        }
Ejemplo n.º 4
0
        public void CanGetUninitializedFactories(Type type)
        {
            // arrange
            var typeAnalyzer = new DefaultTypeAnalyzerService();

            // act
            var uninitializedFactory = typeAnalyzer.GetUninitializedFactory(type);
            var result = uninitializedFactory.DynamicInvoke(null);

            // assert
            result.Should().NotBeNull();
            result.Should().BeOfType(type);
        }
Ejemplo n.º 5
0
 public virtual void Background()
 {
     "Given a new application"
     .f(context =>
     {
         var typeAnalyzerService  = new DefaultTypeAnalyzerService();
         var bootstrapperProvider = new FeatureBootstrapperProvider();
         new Application(
             t => new AggregateRootTypeFactory(typeAnalyzerService, bootstrapperProvider).Create(t),
             t => new EntityTypeFactory(typeAnalyzerService, bootstrapperProvider).Create(t),
             t => new ValueObjectTypeFactory(typeAnalyzerService, bootstrapperProvider).Create(t))
         .Using(context);
     });
 }