public void Setup() { _mocks = new MockRepository(); _treeService = _mocks.DynamicMock <ITreeCreationService>(); _naming = _mocks.DynamicMock <INamingService>(); _mapper = new ViewSourceMapper(new NullLogger(), _treeService, _naming); }
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline. public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory) { loggerFactory.AddConsole(Configuration.GetSection("Logging")); loggerFactory.AddDebug(); if (env.IsDevelopment()) { app.UseDeveloperExceptionPage(); app.UseBrowserLink(); } else { app.UseExceptionHandler("/Home/Error"); } app.UseStaticFiles(); app.UseMvc(routes => { routes.MapRoute( name: "default", template: "{controller=Home}/{action=Index}/{id?}"); }); INamingService namingService = app.ApplicationServices.GetRequiredService <INamingService>(); namingService.Setup(); }
public void Setup() { ccu = new CodeCompileUnit(); mocks = new MockRepository(); engine = Engine.GlobalEngine; engine.BinPath = @"C:\Program Files (x86)\MSBuild"; project = new Project(); buildEngine = mocks.DynamicMock <MockBuildEngine>(project); logger = new NullLogger(); parserService = mocks.DynamicMock <ISiteTreeGeneratorService>(); naming = mocks.DynamicMock <INamingService>(); sourceStorage = mocks.DynamicMock <IParsedSourceStorageService>(); source = mocks.DynamicMock <ISourceGenerator>(); typeResolver = mocks.DynamicMock <ITypeResolver>(); treeService = mocks.DynamicMock <ITreeCreationService>(); viewSourceMapper = mocks.DynamicMock <IViewSourceMapper>(); generator = mocks.DynamicMock <IGenerator>(); task = new GenerateMonoRailSiteTreeTask(logger, parserService, naming, source, sourceStorage, typeResolver, treeService, viewSourceMapper, generator); item = mocks.DynamicMock <ITaskItem>(); parsedSource = mocks.DynamicMock <IParser>(); }
public virtual void Setup() { naming = new DefaultNamingService(); source = new DefaultSourceGenerator(); logging = new NullLogger(); generator = new RouteMapGenerator(logging, source, naming, "TargetNamespace", typeof (IServiceProvider).FullName); }
public void Setup() { _mocks = new MockRepository(); _treeService = _mocks.DynamicMock<ITreeCreationService>(); _naming = _mocks.DynamicMock<INamingService>(); _mapper = new ViewSourceMapper(new NullLogger(), _treeService, _naming); }
public void Setup() { ccu = new CodeCompileUnit(); mocks = new MockRepository(); engine = Engine.GlobalEngine; engine.BinPath = @"C:\Program Files (x86)\MSBuild"; project = new Project(); buildEngine = mocks.DynamicMock<MockBuildEngine>(project); logger = new NullLogger(); parserService = mocks.DynamicMock<ISiteTreeGeneratorService>(); naming = mocks.DynamicMock<INamingService>(); sourceStorage = mocks.DynamicMock<IParsedSourceStorageService>(); source = mocks.DynamicMock<ISourceGenerator>(); typeResolver = mocks.DynamicMock<ITypeResolver>(); treeService = mocks.DynamicMock<ITreeCreationService>(); viewSourceMapper = mocks.DynamicMock<IViewSourceMapper>(); generator = mocks.DynamicMock<IGenerator>(); task = new GenerateMonoRailSiteTreeTask(logger, parserService, naming, source, sourceStorage, typeResolver, treeService, viewSourceMapper, generator); item = mocks.DynamicMock<ITaskItem>(); parsedSource = mocks.DynamicMock<IParser>(); }
public virtual void Setup() { naming = new DefaultNamingService(); source = new DefaultSourceGenerator(); logging = new NullLogger(); generator = new RouteMapGenerator(logging, source, naming, "TargetNamespace", typeof(IServiceProvider).FullName); }
public virtual void Setup() { _mocks = new MockRepository(); _naming = new DefaultNamingService(); _source = new DefaultSourceGenerator(); _logging = new NullLogger(); _generator = new ControllerMapGenerator(_logging, _source, _naming, "TargetNamespace", typeof(IServiceProvider).FullName); }
public ActiveRecordDescriptorBuilder(INamingService namingService, IPlainFieldInferenceService plainFieldsService, IRelationshipInferenceService relationsService) { _namingService = namingService; _plainFieldsService = plainFieldsService; _relationsService = relationsService; }
public MappingPage() : base("Fields mapping") { // This call is required by the Windows Form Designer. InitializeComponent(); naming = ServiceRegistry.Instance[ typeof(INamingService) ] as INamingService; typeInference = ServiceRegistry.Instance[ typeof(ITypeInferenceService) ] as ITypeInferenceService; }
public MappingPage() : base("Fields mapping") { // This call is required by the Windows Form Designer. InitializeComponent(); naming = ServiceRegistry.Instance[typeof(INamingService)] as INamingService; typeInference = ServiceRegistry.Instance[typeof(ITypeInferenceService)] as ITypeInferenceService; }
public virtual void Setup() { _mocks = new MockRepository(); _naming = new DefaultNamingService(); _source = new DefaultSourceGenerator(); _logging = new NullLogger(); _generator = new ActionMapGenerator(_logging, _source, _naming, "TargetNamespace", typeof(IServiceProvider).FullName); }
public virtual void Setup() { mocks = new MockRepository(); naming = new DefaultNamingService(); source = new DefaultSourceGenerator(); logging = new NullLogger(); generator = new ActionMapGenerator(logging, source, naming, "TargetNamespace", typeof (IServiceProvider).FullName); }
public virtual void Setup() { mocks = new MockRepository(); naming = new DefaultNamingService(); source = new DefaultSourceGenerator(); logging = new NullLogger(); generator = new ControllerMapGenerator(logging, source, naming, "TargetNamespace", typeof(IServiceProvider).FullName); }
public virtual void Setup() { naming = new DefaultNamingService(); source = new DefaultSourceGenerator(); // I found a more integration style of testing was better, I started off // mocking calls to ISourceGenerator, and that was just stupid, we want the classes and types and members. // and the assertions here ensure that. logging = new NullLogger(); generator = new ActionMapGenerator(logging, source, naming, "TargetNamespace", typeof(IServiceProvider).FullName); }
public AbstractGenerator(ILogger logger, ISourceGenerator source, INamingService naming, string targetNamespace, string serviceType) { _logger = logger; _source = source; _naming = naming; _namespace = targetNamespace; _serviceType = serviceType; _serviceIdentifier = "services"; }
public virtual void Setup() { naming = new DefaultNamingService(); source = new DefaultSourceGenerator(); // I found a more integration style of testing was better, I started off // mocking calls to ISourceGenerator, and that was just stupid, we want the classes and types and members. // and the assertions here ensure that. logging = new NullLogger(); generator = new ActionMapGenerator(logging, source, naming, "TargetNamespace", typeof (IServiceProvider).FullName); }
protected RouteCreator(string @namespace, ISourceGenerator sourceGenerator, INamingService namingService, T node, CodeTypeDeclaration routeDefinitions, CodeTypeDeclaration routes) { this.@namespace = @namespace; this.sourceGenerator = sourceGenerator; this.namingService = namingService; this.node = node; this.routeDefinitions = routeDefinitions; this.routes = routes; }
public NamingService(INamingService defaultService) { DefaultService = defaultService; EntityAttributeSpecifiedNames = ConfigHelper.GetDictionaryHash("EntityAttributeSpecifiedNames", false); OptionNameValueDuplicates = new Dictionary <OptionSetMetadataBase, Dictionary <string, bool> >(); InvalidCSharpNamePrefix = ConfigHelper.GetAppSettingOrDefault("InvalidCSharpNamePrefix", "_"); LocalOptionSetFormat = ConfigHelper.GetAppSettingOrDefault("LocalOptionSetFormat", "{0}_{1}"); UseDeprecatedOptionSetNaming = ConfigHelper.GetAppSettingOrDefault("UseDeprecatedOptionSetNaming", false); ValidCSharpNameRegEx = ConfigHelper.GetAppSettingOrDefault("ValidCSharpNameRegEx", @"[^a-zA-Z0-9_]"); }
public Generator(string nameSpace, string outputFile, string serviceTypeName, ILogger logger, INamingService namingService, ISourceGenerator sourceGenerator, ITreeCreationService treeCreationService) { this.nameSpace = nameSpace; this.outputFile = outputFile; this.serviceTypeName = serviceTypeName; this.logger = logger; this.namingService = namingService; this.sourceGenerator = sourceGenerator; this.treeCreationService = treeCreationService; }
public NamingService(INamingService defaultService) { DefaultService = defaultService; EntityAttributeSpecifiedNames = ConfigHelper.GetDictionaryHash("EntityAttributeSpecifiedNames", false); OptionNameValueDuplicates = new Dictionary<OptionSetMetadataBase, Dictionary<string, bool>>(); InvalidCSharpNamePrefix = ConfigHelper.GetAppSettingOrDefault("InvalidCSharpNamePrefix", "_"); LocalOptionSetFormat = ConfigHelper.GetAppSettingOrDefault("LocalOptionSetFormat", "{0}_{1}"); UseDeprecatedOptionSetNaming = ConfigHelper.GetAppSettingOrDefault("UseDeprecatedOptionSetNaming", false); ValidCSharpNameRegEx = ConfigHelper.GetAppSettingOrDefault("ValidCSharpNameRegEx", @"[^a-zA-Z0-9_]"); }
public virtual void Setup() { _mocks = new MockRepository(); _naming = new DefaultNamingService(); _source = new DefaultSourceGenerator(); // I found a more integration style of testing was better, I started off // mocking calls to ISourceGenerator, and that was just stupid, we want the classes and types and members. // and the assertions here ensure that. _logging = new NullLogger(); _generator = new ControllerPartialsGenerator(_logging, _source, _naming, "TargetNamespace", typeof(IServiceProvider).FullName); }
public void CreateRelationName() { INamingService service = (INamingService)Kernel[typeof(INamingService)]; Assert.AreEqual("Posts", service.CreateRelationName("Post")); Assert.AreEqual("Children", service.CreateRelationName("child")); Assert.AreEqual("Posts", service.CreateRelationName("posts")); Assert.AreEqual("Posts", service.CreateRelationName("post")); Assert.AreEqual("Orders", service.CreateRelationName("order")); Assert.AreEqual("Facilities", service.CreateRelationName("facility")); }
public void CreatePropertyName() { INamingService service = (INamingService)Kernel[typeof(INamingService)]; Assert.AreEqual("OrderName", service.CreatePropertyName("order_name")); Assert.AreEqual("Name", service.CreatePropertyName("name")); Assert.AreEqual("CustomerName", service.CreatePropertyName("customerName")); Assert.AreEqual("CustomerName", service.CreatePropertyName("customer_Name")); Assert.AreEqual("CustomerName", service.CreatePropertyName("Customer_name")); Assert.AreEqual("Name", service.CreatePropertyName("_name")); }
public virtual void Setup() { _mocks = new MockRepository(); _naming = new DefaultNamingService(); _source = new DefaultSourceGenerator(); // I found a more integration style of testing was better, I started off // mocking calls to ISourceGenerator, and that was just stupid, we want the classes and types and members. // and the assertions here ensure that. _logging = new NullLogger(); _generator = new ControllerPartialsGenerator(_logging, _source, _naming, "TargetNamespace", typeof (IServiceProvider).FullName); }
public GenerateMonoRailSiteTreeTask() { _logger = new MsBuildLogger(this.Log); _naming = new DefaultNamingService(); _treeService = new DefaultTreeCreationService(); _source = new DefaultSourceGenerator(); _viewSourceMapper = new ViewSourceMapper(_logger, _treeService, _naming); _sourceStorage = new DefaultSourceStorageService(); _typeResolver = new TypeResolver(); _service = new SiteTreeGeneratorService(_logger, _typeResolver, _sourceStorage, new NRefactoryParserFactory()); this.ServiceTypeName = typeof(ICodeGeneratorServices).FullName; }
public override void Activated(System.Collections.IDictionary context) { TableDefinition table = context["selectedtable"] as TableDefinition; if (table != _oldTable) { _oldTable = table; INamingService naming = ServiceRegistry.Instance[typeof(INamingService)] as INamingService; className.Text = naming.CreateClassName(table.Name); } }
public void CreateClassName() { INamingService service = (INamingService)Kernel[typeof(INamingService)]; Assert.AreEqual("Author", service.CreateClassName("authors")); Assert.AreEqual("Tax", service.CreateClassName("Taxes")); Assert.AreEqual("Child", service.CreateClassName("children")); Assert.AreEqual("Order", service.CreateClassName("Orders")); Assert.AreEqual("Order", service.CreateClassName("Order")); Assert.AreEqual("Order", service.CreateClassName("_Order")); Assert.AreEqual("Order", service.CreateClassName("tb_Order")); Assert.AreEqual("Order", service.CreateClassName("tb_Orders")); }
public GenerateMonoRailSiteTreeTask(ILogger logger, ISiteTreeGeneratorService service, INamingService naming, ISourceGenerator source, IParsedSourceStorageService sourceStorage, ITypeResolver typeResolver, ITreeCreationService treeService, IViewSourceMapper viewSourceMapper, IGenerator generator) { _service = service; _logger = logger; _naming = naming; _source = source; _sourceStorage = sourceStorage; _typeResolver = typeResolver; _treeService = treeService; _viewSourceMapper = viewSourceMapper; _generators.Add(generator); this.ServiceTypeName = typeof(ICodeGeneratorServices).FullName; }
public GenerateMonoRailSiteTreeTask() { logger = new MsBuildLogger(Log); naming = new DefaultNamingService(); treeService = new DefaultTreeCreationService(); source = new DefaultSourceGenerator(); viewSourceMapper = new ViewSourceMapper(logger, treeService); sourceStorage = new DefaultSourceStorageService(); typeResolver = new TypeResolver(); service = new SiteTreeGeneratorService(logger, typeResolver, sourceStorage, new NRefactoryParserFactory()); ServiceTypeName = typeof(ICodeGeneratorServices).FullName; ViewComponentSources = new ITaskItem[0]; AssemblyReferences = new ITaskItem[0]; }
internal CodeGenerationServiceProvider( ITypeMappingService typeMappingService , ICodeGenerationService codeGenerationService , ICodeWriterFilterService codeFilterService , IMetadataProviderService metadataProviderService , INamingService namingService ) { this.TypeMappingService = typeMappingService; this.CodeGenerationService = codeGenerationService; this.CodeWriterFilterService = codeFilterService; this.MetadataProviderService = metadataProviderService; this.NamingService = namingService; }
public void TestInitialise() { metadataProviderService = Substitute.For <IMetadataProviderService>(); organizationMetadata = Substitute.For <IOrganizationMetadata>(); metadataProviderService.LoadMetadata().Returns(organizationMetadata); serviceProvider.GetService(typeof(IMetadataProviderService)).Returns(metadataProviderService); namingService = Substitute.For <INamingService>(); parameters = new Dictionary <string, string> { { "UseDisplayNames", true.ToString() } }; testMetadata = new TestMetadata(filterService); organizationMetadata.Entities.Returns(testMetadata.ToArray()); sut = new CodeNamingService(namingService, parameters); }
public GenerateMonoRailSiteTreeTask(ILogger logger, ISiteTreeGeneratorService service, INamingService naming, ISourceGenerator source, IParsedSourceStorageService sourceStorage, ITypeResolver typeResolver, ITreeCreationService treeService, IViewSourceMapper viewSourceMapper, IGenerator generator) { this.service = service; this.logger = logger; this.naming = naming; this.source = source; this.sourceStorage = sourceStorage; this.typeResolver = typeResolver; this.treeService = treeService; this.viewSourceMapper = viewSourceMapper; generators.Add(generator); ServiceTypeName = typeof(ICodeGeneratorServices).FullName; ViewComponentSources = new ITaskItem[0]; AssemblyReferences = new ITaskItem[0]; }
public void Setup() { _ccu = new CodeCompileUnit(); _mocks = new MockRepository(); _engine = Engine.GlobalEngine; _engine.BinPath = @"C:\Program Files (x86)\MSBuild"; _project = new Project(); _buildEngine = _mocks.DynamicMock <MockBuildEngine>(_project); _logger = new NullLogger(); _parserService = _mocks.DynamicMock <ISiteTreeGeneratorService>(); _naming = _mocks.DynamicMock <INamingService>(); _sourceStorage = _mocks.DynamicMock <IParsedSourceStorageService>(); _source = _mocks.DynamicMock <ISourceGenerator>(); _typeResolver = _mocks.DynamicMock <ITypeResolver>(); _treeService = _mocks.DynamicMock <ITreeCreationService>(); _viewSourceMapper = _mocks.DynamicMock <IViewSourceMapper>(); _generator = _mocks.DynamicMock <IGenerator>(); _task = new GenerateMonoRailSiteTreeTask(_logger, _parserService, _naming, _source, _sourceStorage, _typeResolver, _treeService, _viewSourceMapper, _generator); _item = _mocks.DynamicMock <ITaskItem>(); _parsedSource = _mocks.DynamicMock <IParser>(); }
public RouteMapGenerator(ILogger logger, ISourceGenerator source, INamingService naming, string targetNamespace, string serviceType) : base(logger, source, naming, targetNamespace, serviceType) { }
public ViewSourceMapper(ILogger logger, ITreeCreationService treeService, INamingService naming) { _logger = logger; _treeService = treeService; _naming = naming; }
public ControllerMapGenerator(ILogger logger, ISourceGenerator source, INamingService naming, string targetNamespace, string serviceType) : base(logger, source, naming, targetNamespace, serviceType) { }
public Naming(INamingService defaulService) { DefaultService = defaulService; }
public RelationshipBuilder(INamingService namingService) { _namingService = namingService; }
public void Setup() { _ccu = new CodeCompileUnit(); _mocks = new MockRepository(); _engine = Engine.GlobalEngine; _engine.BinPath = @"C:\Program Files (x86)\MSBuild"; _project = new Project(); _buildEngine = _mocks.DynamicMock<MockBuildEngine>(_project); _logger = new NullLogger(); _parserService = _mocks.DynamicMock<ISiteTreeGeneratorService>(); _naming = _mocks.DynamicMock<INamingService>(); _sourceStorage = _mocks.DynamicMock<IParsedSourceStorageService>(); _source = _mocks.DynamicMock<ISourceGenerator>(); _typeResolver = _mocks.DynamicMock<ITypeResolver>(); _treeService = _mocks.DynamicMock<ITreeCreationService>(); _viewSourceMapper = _mocks.DynamicMock<IViewSourceMapper>(); _generator = _mocks.DynamicMock<IGenerator>(); _task = new GenerateMonoRailSiteTreeTask(_logger, _parserService, _naming, _source, _sourceStorage, _typeResolver, _treeService, _viewSourceMapper, _generator); _item = _mocks.DynamicMock<ITaskItem>(); _parsedSource = _mocks.DynamicMock<IParser>(); }
public RelationshipInferenceService(INamingService namingService) { _namingService = namingService; }
public SingleEntityNamingService(INamingService namingService) { this.namingService = namingService; }
public PlainFieldInferenceService(INamingService namingService, ITypeInferenceService typeInfService) { _namingService = namingService; _typeInfService = typeInfService; }
public CompositeNamingService(INamingService defaultService, IServiceExtensionsConfiguration configuration) : base(defaultService, configuration) { InitalizeNamers(); }
public NamingService(INamingService namingService) { DefaultNamingService = namingService; OptionNames = new Dictionary<OptionSetMetadataBase, Dictionary<String, int>>(); }
public ControllerPartialsGenerator(ILogger logger, ISourceGenerator source, INamingService naming, string targetNamespace, string serviceType) : base(logger, source, naming, targetNamespace, serviceType) { }
public CodeDomGenerator(INamingService namingService) { _namingService = namingService; }
private CodeTypeDeclaration GenerateEnum(EntityMetadata entityMetadata, MultiSelectPicklistAttributeMetadata metadata, IServiceProvider services, INamingService service) { var name = service.GetNameForOptionSet(entityMetadata, metadata.OptionSet, services); var type = new CodeTypeDeclaration(name) { IsEnum = true }; type.CustomAttributes.Add(new CodeAttributeDeclaration(new CodeTypeReference(typeof(DataContractAttribute)))); var version = System.Diagnostics.FileVersionInfo.GetVersionInfo(typeof(INamingService).Assembly.Location).ProductVersion; type.CustomAttributes.Add(new CodeAttributeDeclaration( new CodeTypeReference(typeof(GeneratedCodeAttribute)), new CodeAttributeArgument(new CodePrimitiveExpression("CrmSvcUtil")), new CodeAttributeArgument(new CodePrimitiveExpression(version)))); foreach (var option in metadata.OptionSet.Options) { // Creates the enum member CodeMemberField value = new CodeMemberField { Name = service.GetNameForOption(metadata.OptionSet, option, services), InitExpression = new CodePrimitiveExpression(option.Value.GetValueOrDefault()) }; value.CustomAttributes.Add(new CodeAttributeDeclaration(new CodeTypeReference(typeof(EnumMemberAttribute)))); type.Members.Add(value); } return(type); }
public OverridePropertyNames(INamingService defaultService) { DefaultService = defaultService; EntityAttributeSpecifiedNames = ConfigHelper.GetDictionaryList(ConfigurationManager.AppSettings["EntityAttributeSpecifiedNames"], false); }