public void Setup()
 {
   _mocks = new MockRepository();
   _treeService = _mocks.DynamicMock<ITreeCreationService>();
   _naming = _mocks.DynamicMock<INamingService>();
   _mapper = new ViewSourceMapper(new NullLogger(), _treeService, _naming);
 }
		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()
		{
			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>();
		}
Example #4
0
		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 ControllerMapGenerator(_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 ActiveRecordDescriptorBuilder(INamingService namingService,
			IPlainFieldInferenceService plainFieldsService, 
			IRelationshipInferenceService relationsService)
		{
			_namingService = namingService;
			_plainFieldsService = plainFieldsService;
			_relationsService = relationsService;
		}
		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);
		}
 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_]");
 }
Example #11
0
		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 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(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];
		}
		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 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;
 }
Example #16
0
		public RelationshipBuilder(INamingService namingService)
		{
			_namingService = namingService;
		}
 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 RouteMapGenerator(ILogger logger, ISourceGenerator source, INamingService naming, string targetNamespace,
		                         string serviceType) : base(logger, source, naming, targetNamespace, serviceType)
		{
		}
Example #19
0
 public NamingService(INamingService namingService)
 {
     DefaultNamingService = namingService;
     OptionNames = new Dictionary<OptionSetMetadataBase,
         Dictionary<String, int>>();
 }
    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 OverridePropertyNames(INamingService defaultService)
 {
     DefaultService = defaultService;
     EntityAttributeSpecifiedNames = ConfigHelper.GetDictionaryList(ConfigurationManager.AppSettings["EntityAttributeSpecifiedNames"], false);
 }
		public PlainFieldInferenceService(INamingService namingService, ITypeInferenceService typeInfService)
		{
			_namingService = namingService;
			_typeInfService = typeInfService;
		}
Example #23
0
		public CodeDomGenerator(INamingService namingService)
		{
			_namingService = namingService;
		}
		public ControllerPartialsGenerator(ILogger logger, ISourceGenerator source, INamingService naming,
		                                   string targetNamespace, string serviceType)
			: base(logger, source, naming, targetNamespace, serviceType)
		{
		}
Example #25
0
 public ViewSourceMapper(ILogger logger, ITreeCreationService treeService, INamingService naming)
 {
   _logger = logger;
   _treeService = treeService;
   _naming = naming;
 }
		public RelationshipInferenceService(INamingService namingService)
		{
			_namingService = namingService;
		}