public virtual void Setup() { response = new StubResponse(); var url = new UrlInfo("eleutian.com", "www", virtualDirectory, "http", 80, Path.Combine(Path.Combine("Area", "Controller"), "Action"), "Area", "Controller", "Action", "rails", ""); var stubEngineContext = new StubEngineContext(new StubRequest(), response, new StubMonoRailServices(), url) { Server = MockRepository.GenerateMock<IServerUtility>() }; railsContext = stubEngineContext; serverUtility = railsContext.Server; argumentConversionService = MockRepository.GenerateMock<IArgumentConversionService>(); controller = new TestController(); controller.Contextualize(railsContext, MockRepository.GenerateStub<IControllerContext>()); parameters = new Hashtable(); services = MockRepository.GenerateMock<ICodeGeneratorServices>(); services.Expect(s => s.ArgumentConversionService).Return(argumentConversionService).Repeat.Any(); services.Expect(s => s.Controller).Return(controller).Repeat.Any(); services.Expect(s => s.RailsContext).Return(railsContext).Repeat.Any(); argumentConversionService.Expect(s => s.CreateParameters()).Return(parameters).Repeat.Any(); }
public virtual void Setup() { response = new StubResponse(); var url = new UrlInfo("eleutian.com", "www", virtualDirectory, "http", 80, Path.Combine(Path.Combine("Area", "Controller"), "Action"), "Area", "Controller", "Action", "rails", ""); var stubEngineContext = new StubEngineContext(new StubRequest(), response, new StubMonoRailServices(), url) { Server = MockRepository.GenerateMock <IServerUtility>() }; railsContext = stubEngineContext; serverUtility = railsContext.Server; argumentConversionService = MockRepository.GenerateMock <IArgumentConversionService>(); controller = new TestController(); controller.Contextualize(railsContext, MockRepository.GenerateStub <IControllerContext>()); parameters = new Hashtable(); services = MockRepository.GenerateMock <ICodeGeneratorServices>(); services.Expect(s => s.ArgumentConversionService).Return(argumentConversionService).Repeat.Any(); services.Expect(s => s.Controller).Return(controller).Repeat.Any(); services.Expect(s => s.RailsContext).Return(railsContext).Repeat.Any(); argumentConversionService.Expect(s => s.CreateParameters()).Return(parameters).Repeat.Any(); }
public IControllerActionReference CreateActionReference(ICodeGeneratorServices services, Type controllerType, string areaName, string controllerName, string actionName, MethodSignature signature, params ActionArgument[] arguments) { return(new ControllerActionReference(services, controllerType, areaName, controllerName, actionName, signature, arguments)); }
public virtual void Setup() { _mocks = new MockRepository(); _services = _mocks.DynamicMock <ICodeGeneratorServices>(); _controller = _mocks.DynamicMock <TestController>(); _factory = new DefaultControllerReferenceFactory(); }
/// <summary> /// 构造函数 /// </summary> public ToolsController( IHttpContextUser user , IWebHostEnvironment webHostEnvironment , ISysUserServices sysUserServices , ISysRoleServices sysRoleServices , ISysMenuServices sysMenuServices , ISysUserRoleServices sysUserRoleServices , ISysOrganizationServices sysOrganizationServices, ICodeGeneratorServices codeGeneratorServices, ISysLoginRecordServices sysLoginRecordServices, ISysNLogRecordsServices sysNLogRecordsServices, IOptions <FilesStorageOptions> filesStorageOptions, ISysRoleMenuServices sysRoleMenuServices) { _user = user; _webHostEnvironment = webHostEnvironment; _sysUserServices = sysUserServices; _sysRoleServices = sysRoleServices; _sysMenuServices = sysMenuServices; _sysUserRoleServices = sysUserRoleServices; _sysOrganizationServices = sysOrganizationServices; _codeGeneratorServices = codeGeneratorServices; _sysLoginRecordServices = sysLoginRecordServices; _sysNLogRecordsServices = sysNLogRecordsServices; _sysRoleMenuServices = sysRoleMenuServices; _filesStorageOptions = filesStorageOptions.Value; }
public virtual void Setup() { _mocks = new MockRepository(); _services = _mocks.DynamicMock<ICodeGeneratorServices>(); _controller = _mocks.DynamicMock<TestController>(); _factory = new DefaultControllerReferenceFactory(); }
public ControllerViewReference(ICodeGeneratorServices services, Type controllerType, string areaName, string controllerName, string actionName) { if (services == null) { throw new ArgumentNullException("services"); } if (controllerType == null) { throw new ArgumentNullException("controllerType"); } if (String.IsNullOrEmpty(controllerName)) { throw new ArgumentNullException("controllerName"); } if (String.IsNullOrEmpty(actionName)) { throw new ArgumentNullException("actionName"); } _services = services; _controllerType = controllerType; _controllerName = controllerName; _areaName = areaName; _actionName = actionName; }
public IControllerActionReference CreateActionReference(ICodeGeneratorServices services, Type controllerType, string areaName, string controllerName, string actionName, MethodSignature signature, params ActionArgument[] arguments) { return new ControllerActionReference(services, controllerType, areaName, controllerName, actionName, signature, arguments); }
public ControllerActionReference(ICodeGeneratorServices services, Type controllerType, string areaName, string controllerName, string actionName, MethodSignature signature, params ActionArgument[] arguments) : base(services, controllerType, areaName, controllerName, actionName) { _arguments = arguments; _signature = signature; }
public ControllerActionReference(ICodeGeneratorServices services, Type controllerType, string areaName, string controllerName, string actionName, MethodSignature signature, params ActionArgument[] arguments) : base(services, controllerType, areaName, controllerName, actionName) { Arguments = arguments; ActionMethodSignature = signature; }
public IControllerViewReference CreateViewReference(ICodeGeneratorServices services, Type controllerType, string areaName, string controllerName, string actionName) { string key = MakeKey(areaName, controllerName, actionName); if (!_views.ContainsKey(key)) { _views[key] = ReplayIfNecessary(_mocks.DynamicMock <ControllerViewReference>(services, controllerType, areaName, controllerName, actionName)); } return(_views[key]); }
public ControllerViewReference(ICodeGeneratorServices services, Type controllerType, string areaName, string controllerName, string actionName) { if (services == null) throw new ArgumentNullException("services"); if (controllerType == null) throw new ArgumentNullException("controllerType"); if (String.IsNullOrEmpty(controllerName)) throw new ArgumentNullException("controllerName"); if (String.IsNullOrEmpty(actionName)) throw new ArgumentNullException("actionName"); Services = services; ControllerType = controllerType; ControllerName = controllerName; AreaName = areaName; ActionName = actionName; }
public IControllerActionReference CreateActionReference(ICodeGeneratorServices services, Type controllerType, string areaName, string controllerName, string actionName, MethodSignature signature, params ActionArgument[] arguments) { string key = MakeKey(areaName, controllerName, actionName); if (!_actions.ContainsKey(key)) { _actions[key] = ReplayIfNecessary(_mocks.DynamicMock <ControllerActionReference>(services, controllerType, areaName, controllerName, actionName, signature, arguments)); } return(_actions[key]); }
public virtual void Setup() { _mocks = new MockRepository(); _services = _mocks.DynamicMock <ICodeGeneratorServices>(); _response = new StubResponse(); UrlInfo url = new UrlInfo("eleutian.com", "www", _virtualDirectory, "http", 80, Path.Combine(Path.Combine("Area", "Controller"), "Action"), "Area", "Controller", "Action", "rails", ""); _railsContext = new StubEngineContext(new StubRequest(), _response, new StubMonoRailServices(), url); ((StubEngineContext)_railsContext).Server = _mocks.DynamicMock <IServerUtility>(); _serverUtility = _railsContext.Server; _argumentConversionService = _mocks.DynamicMock <IArgumentConversionService>(); _controller = new TestController(); }
public virtual void Setup() { _mocks = new MockRepository(); _services = _mocks.DynamicMock<ICodeGeneratorServices>(); _response = new StubResponse(); UrlInfo url = new UrlInfo("eleutian.com", "www", _virtualDirectory, "http", 80, Path.Combine(Path.Combine("Area", "Controller"), "Action"), "Area", "Controller", "Action", "rails", ""); _railsContext = new StubEngineContext(new StubRequest(), _response, new StubMonoRailServices(), url); ((StubEngineContext)_railsContext).Server = _mocks.DynamicMock<IServerUtility>(); _serverUtility = _railsContext.Server; _argumentConversionService = _mocks.DynamicMock<IArgumentConversionService>(); _controller = new TestController(); }
public IControllerViewReference CreateViewReference(ICodeGeneratorServices services, Type controllerType, string areaName, string controllerName, string actionName) { return(new ControllerViewReference(services, controllerType, areaName, controllerName, actionName)); }
public IControllerViewReference CreateViewReference(ICodeGeneratorServices services, Type controllerType, string areaName, string controllerName, string actionName) { return new ControllerViewReference(services, controllerType, areaName, controllerName, actionName); }
public virtual void Setup() { mocks = new MockRepository(); services = mocks.DynamicMock <ICodeGeneratorServices>(); factory = new DefaultControllerReferenceFactory(); }
public virtual void Setup() { mocks = new MockRepository(); services = mocks.DynamicMock<ICodeGeneratorServices>(); factory = new DefaultControllerReferenceFactory(); }
/// <summary> /// 构造函数 /// </summary> public CodeGeneratorController(ICodeGeneratorServices codeGeneratorServices, IMapper mapper, IWebHostEnvironment webHostEnvironment) { _codeGeneratorServices = codeGeneratorServices; _mapper = mapper; _webHostEnvironment = webHostEnvironment; }