public LifeCycleManager(IAuthenticationProvider authenticationProvider, String entityType) { Debug.WriteLine("Create new instance of LifeCycleManager for entityType '{0}'", entityType); _entityType = entityType; lock (_lock) { if (null == _staticStateMachineConfigLoader) { LoadAndComposeParts(); _staticStateMachineConfigLoader = _stateMachineConfigLoader; _staticCalloutExecutor = _calloutExecutor; } else { _stateMachineConfigLoader = _staticStateMachineConfigLoader; _calloutExecutor = _staticCalloutExecutor; } } _coreService = new CumulusCoreService.Core(new Uri(ConfigurationManager.AppSettings[CORE_ENDPOINT_URL_KEY])); _coreService.BuildingRequest += CoreServiceOnBuildingRequest; _entityController = new EntityController(authenticationProvider); _stateMachine = new StateMachine.StateMachine(); ConfigureStateMachine(entityType); }
public void TestInitialize() { Mock.SetupStatic(typeof(ODataControllerHelper)); Mock.SetupStatic(typeof(CurrentUserDataProvider)); Mock.SetupStatic(typeof(HttpContext)); Mock.Arrange(() => HttpContext.Current.Request.Headers.Get(TENANT_ID_HEADER_KEY)) .Returns(TENANT_ID) .OccursOnce(); _lifeCyclesController = new LifeCyclesController(); _coreService = Mock.Create <CumulusCoreService.Core>(); }
public LifeCyclesController() { var declaringType = System.Reflection.MethodBase.GetCurrentMethod().DeclaringType; var fn = String.Format("{0}:{1}", declaringType.Namespace, declaringType.Name); _coreService = new CumulusCoreService.Core( new Uri(ConfigurationManager.AppSettings[CORE_ENDPOINT_URL_KEY])); _coreService.Credentials = new NetworkCredential(_username, _password); _coreService.BuildingRequest += CoreServiceOnBuildingRequest; Debug.WriteLine(fn); }
public void TestInitialize() { Mock.SetupStatic(typeof(CurrentUserDataProvider)); Mock.SetupStatic(typeof(HttpContext)); Mock.SetupStatic(typeof(CredentialCache)); _stateMachineConfigLoader = Mock.Create <IStateMachineConfigLoader>(); _authenticationProvider = Mock.Create <IAuthenticationProvider>(); _coreService = Mock.Create <CumulusCoreService.Core>(); _calloutExecutor = Mock.Create <ICalloutExecutor>(); _entityController = Mock.Create <EntityController>(); _windowsIdentity = Mock.Create <WindowsIdentity>(); var hashGenerator = Mock.Create <SHA256>(); Mock.Arrange(() => hashGenerator.ComputeHash(Arg.IsAny <byte[]>())) .IgnoreInstance() .Returns(StringToByteArray(SAMPLE_TOKEN)); }
public void TestInitialize() { Mock.SetupStatic(typeof(CurrentUserDataProvider)); Mock.SetupStatic(typeof(HttpContext)); Mock.SetupStatic(typeof(CredentialCache)); _stateMachineConfigLoader = Mock.Create<IStateMachineConfigLoader>(); _authenticationProvider = Mock.Create<IAuthenticationProvider>(); _coreService = Mock.Create<CumulusCoreService.Core>(); _calloutExecutor = Mock.Create<ICalloutExecutor>(); _entityController = Mock.Create<EntityController>(); _windowsIdentity = Mock.Create<WindowsIdentity>(); var hashGenerator = Mock.Create<SHA256>(); Mock.Arrange(() => hashGenerator.ComputeHash(Arg.IsAny<byte[]>())) .IgnoreInstance() .Returns(StringToByteArray(SAMPLE_TOKEN)); }