public void TestFactoryReturnsConnector240OpenEngSBVersionWithUsernamePassword() { OpenEngSB300.SetSupport(); IDomainFactory factory = DomainFactoryProvider.GetDomainFactoryInstance <String>(Version240, NullString, NullString, NullExceptionHandler, Username, Password); Assert.IsNotNull(factory); }
public void TestFactoryReturnsConnector300OpenEngSBVersion() { OpenEngSB300.SetSupport(); IDomainFactory factory = DomainFactoryProvider.GetDomainFactoryInstance <String>(Version300, NullString, NullString); Assert.IsNotNull(factory); }
public override void Init() { uuid = Guid.NewGuid().ToString(); ExampleDomainConnector exampleDomain = new ExampleDomainConnector(); factory = DomainFactoryProvider.GetDomainFactoryInstance(Version, Destination, exampleDomain, new ForwardDefaultExceptionHandler(), Username, Password); }
public override void Init() { exceptionHandler = new RetryDefaultExceptionHandler(); ExampleDomainConnector exampleDomain = new ExampleDomainConnector(); factory = DomainFactoryProvider.GetDomainFactoryInstance("3.0.0", Destination, exampleDomain, exceptionHandler); }
public PersonsStorage(ILogger logger, IDomainFactory domainFactory, IEventStreamStorage <PersonAggregate> eventStreamStorage, IRepository repository) { this.queryStorage = new GeneralQueryStorage <Person>(logger, domainFactory, repository); this.eventingStorage = eventStreamStorage; }
public PersonStorage(IRecorder recorder, IDomainFactory domainFactory, IEventStreamStorage <PersonEntity> eventStreamStorage, IRepository repository) { this.queryStorage = new GeneralQueryStorage <Person>(recorder, domainFactory, repository); this.eventingStorage = eventStreamStorage; }
public void TestFactoryReturnsConnector300OpenEngSBVersionWithExceptionHandlerParameter() { OpenEngSB300.SetSupport(); IDomainFactory factory = DomainFactoryProvider.GetDomainFactoryInstance <String>(Version300, NullString, NullString, forwardDefaultExceptionHandler); Assert.IsNotNull(factory); }
public HomeController(IDataSource dataSource, IDomainFactory domainFactory) { Contract.Requires(dataSource != null); Contract.Requires(domainFactory != null); domain = domainFactory.Create(dataSource); }
private PhilosopherRunner[] CreatePhilosopherRunners(TableType tableType, int count) { IDomainFactory domainFactory = domainFactory_(tableType); Philosopher[] philosophers = domainFactory.CreateDiningPhilosophers(count); PhilosopherRunner[] runners = philosophers.Select(_ => new PhilosopherRunner(_)).ToArray(); return(runners); }
/// <summary> /// Sets up the context with the appropriate dependencies. /// </summary> /// <param name="repository">The repository for the domain.</param> /// <param name="domainFactory">The domain instance factory for the domain.</param> /// <param name="queryFactory">The query factory for the domain.</param> public static void Setup(IRepository repository, IDomainFactory domainFactory, IQueryFactory queryFactory) { _contextStorage.SetData(StorageKeyRepository, repository); _contextStorage.SetData(StorageKeyDomainFactory, domainFactory); _contextStorage.SetData(StorageKeyQueryFactory, queryFactory); }
public CreateInstitute(IDomainFactory domainFactory, IInstituteRepository instituteRepository, IInstituteObserver instituteObserver, string name) { this.domainFactory = domainFactory; this.instituteRepository = instituteRepository; this.name = name; this.instituteObserver = instituteObserver; }
public void TestRetryExceptionHandlerRetiesTheMethod() { IDomainFactory factory = DomainFactoryProvider.GetDomainFactoryInstance(Version, "FooBar", new ExampleDomainConnector(), new RetryDefaultExceptionHandler()); // Visual Studio unit tests does not work, when a threads are used. factory.StopAllConnections(); factory.CreateDomainService(DomainName); }
public void CreateBusinessObjects() { IDomainFactory factory = this.container.Resolve <IDomainFactory>("AddressFactory"); Address ad = (Address)factory.CreateDomainObject(); Assert.IsTrue(ad != null); }
public EvaluationService(IUnitOfWork unitOfWork, ISubjectFactory subjectFactory, IDomainFactory domainFactory) : base(unitOfWork) { this.subjectFactory = subjectFactory; this.domainFactory = domainFactory; }
public TEntity ToEntity <TEntity>(IDomainFactory domainFactory) where TEntity : IQueryableEntity, new() { domainFactory.GuardAgainstNull(nameof(domainFactory)); var properties = ConvertToDomainProperties(domainFactory); return(properties.FromObjectDictionary <TEntity>()); }
public DefaultController(IDomainFactory domainFactory, INobleRepository nobleRepository, IInstituteRepository instituteRepository, IUIFactory uifactory, ICommandProcessor commandProcessor) { this.domainFactory = domainFactory; this.uiFactory = uifactory; this.nobleRepository = nobleRepository; this.instituteRepository = instituteRepository; this.commandProcessor = commandProcessor; }
public GeneralQueryStorage(ILogger logger, IDomainFactory domainFactory, IRepository repository) { logger.GuardAgainstNull(nameof(logger)); repository.GuardAgainstNull(nameof(repository)); domainFactory.GuardAgainstNull(nameof(domainFactory)); this.logger = logger; this.repository = repository; this.domainFactory = domainFactory; this.containerName = typeof(TDto).GetEntityNameSafe(); }
public TEntity ToDomainEntity <TEntity>(IDomainFactory domainFactory) where TEntity : IPersistableEntity { domainFactory.GuardAgainstNull(nameof(domainFactory)); var domainProperties = ConvertToDomainProperties(domainFactory); var result = domainFactory.RehydrateEntity(typeof(TEntity), domainProperties); return((TEntity)result); }
public RegisterNoble(IDomainFactory domainFactory, IInstituteRepository instituteRepository, INobleRepository nobleRepository, INobleObserver nobleObserver, string title, int instituteId) { this.domainFactory = domainFactory; this.instituteRepository = instituteRepository; this.nobleRepository = nobleRepository; this.nobleObserver = nobleObserver; this.title = title; this.instituteId = instituteId; }
public async Task <IActionResult> Update([FromRoute] Guid?id, [FromBody] Domain domain) { IActionResult result = null; try { if (result == null && (!id.HasValue || id.Value.Equals(Guid.Empty))) { result = BadRequest("Missing domain id value"); } if (result == null && domain == null) { result = BadRequest("Missing domain data"); } if (result == null && string.IsNullOrEmpty(domain.Name)) { result = BadRequest("Missing domain name value"); } if (result == null) { using ILifetimeScope scope = _container.BeginLifetimeScope(); SettingsFactory settingsFactory = scope.Resolve <SettingsFactory>(); CoreSettings settings = settingsFactory.CreateAccount(_settings.Value); IDomainFactory domainFactory = scope.Resolve <IDomainFactory>(); IDomain innerDomain = await domainFactory.Get(settings, id.Value); if (result == null && innerDomain == null) { result = NotFound(); } if (result == null && !UserCanAccessAccount(innerDomain.AccountId)) { result = StatusCode(StatusCodes.Status401Unauthorized); } if (result == null) { IMapper mapper = MapperConfigurationFactory.CreateMapper(); mapper.Map <Domain, IDomain>(domain, innerDomain); IDomainSaver saver = scope.Resolve <IDomainSaver>(); await saver.Update(settings, innerDomain); result = Ok(mapper.Map <Domain>(innerDomain)); } } } catch (Exception ex) { using (ILifetimeScope scope = _container.BeginLifetimeScope()) { await LogException(ex, scope.Resolve <IExceptionService>(), scope.Resolve <SettingsFactory>(), _settings.Value); } result = StatusCode(StatusCodes.Status500InternalServerError); } return(result); }
public PaymentStorage(ILogger logger, IDomainFactory domainFactory, IEventStreamStorage <PaymentEntity> eventStreamStorage, IRepository repository) { logger.GuardAgainstNull(nameof(logger)); domainFactory.GuardAgainstNull(nameof(domainFactory)); eventStreamStorage.GuardAgainstNull(nameof(eventStreamStorage)); repository.GuardAgainstNull(nameof(repository)); this.eventingStorage = eventStreamStorage; }
public GeneralCommandStorage(IRecorder recorder, IDomainFactory domainFactory, IRepository repository) { recorder.GuardAgainstNull(nameof(recorder)); domainFactory.GuardAgainstNull(nameof(domainFactory)); repository.GuardAgainstNull(nameof(repository)); this.recorder = recorder; this.domainFactory = domainFactory; this.repository = repository; this.containerName = typeof(TEntity).GetEntityNameSafe(); }
public ChangeOrganizationCommandHandler(IAmACommandProcessor commandProcessor, IOrganizationRepository repository, IDomainFactory domainFactory, IDomainTracking <Organization> domainTracking, ILog logger) : base(logger) { _commandProcessor = commandProcessor; _repository = repository; _domainFactory = domainFactory; _domainTracking = domainTracking; }
public void TestGetCustomerById() { int entityId = custTestId; IUnityContainer container = GenericSingleton <ComponentContainer> .GetInstance().Container; IDomainFactory factory = container.Resolve <CustomerFactory>(); IDomainObject c = factory.GetBusinessEntityById(entityId); Assert.AreEqual(entityId, c.BusinessEntityID); }
/// <summary> /// Creates/Registers the connector at the OpenEngSB and registers the connector to XLink /// </summary> public void connectToOpenEngSbWithXLink() { outputLine("Trying to connect to OpenEngSB and XLink..."); ooSourceConnector = new OOSourceCodeConnector(); factory = DomainFactoryProvider.GetDomainFactoryInstance("3.0.0", xlinkServerURL, ooSourceConnector, new ForwardDefaultExceptionHandler()); connectorUUID = factory.CreateDomainService(domainId); factory.RegisterConnector(connectorUUID, domainId); blueprint = factory.ConnectToXLink(connectorUUID, hostIp, programname, initModelViewRelation()); setCurrentlyInstalledTools(blueprint.registeredTools); connected = true; outputLine("Connecting done."); }
public ReadModelCheckpointStore(IRecorder recorder, IIdentifierFactory idFactory, IDomainFactory domainFactory, IRepository repository) { recorder.GuardAgainstNull(nameof(recorder)); idFactory.GuardAgainstNull(nameof(idFactory)); repository.GuardAgainstNull(nameof(repository)); domainFactory.GuardAgainstNull(nameof(domainFactory)); this.recorder = recorder; this.idFactory = idFactory; this.repository = repository; this.domainFactory = domainFactory; }
public void TestGetPhoneByMasterId() { int masterId = 504438; IUnityContainer container = GenericSingleton <ComponentContainer> .GetInstance().Container; IDomainFactory factory = container.Resolve <PhoneFactory>(); Phone ph = (Phone)factory.GetBusinessEntityByMasterEntityId(masterId); Assert.AreEqual(masterId, ph.customerId); }
public void TestGetPhoneById() { int entityId = phoneTestId; IUnityContainer container = GenericSingleton <ComponentContainer> .GetInstance().Container; IDomainFactory factory = container.Resolve <PhoneFactory>(); Phone ph = (Phone)factory.GetBusinessEntityById(entityId); Assert.AreEqual(entityId, ph.BusinessEntityID); }
public GeneralEventStreamStorage(IRecorder recorder, IDomainFactory domainFactory, IChangeEventMigrator migrator, IRepository repository) { recorder.GuardAgainstNull(nameof(recorder)); repository.GuardAgainstNull(nameof(repository)); domainFactory.GuardAgainstNull(nameof(domainFactory)); migrator.GuardAgainstNull(nameof(migrator)); this.recorder = recorder; this.repository = repository; this.domainFactory = domainFactory; this.migrator = migrator; this.containerName = typeof(TAggregateRoot).GetEntityNameSafe(); }
public CarStorage(IRecorder recorder, IDomainFactory domainFactory, IEventStreamStorage <CarEntity> eventStreamStorage, IRepository repository) { recorder.GuardAgainstNull(nameof(recorder)); domainFactory.GuardAgainstNull(nameof(domainFactory)); eventStreamStorage.GuardAgainstNull(nameof(eventStreamStorage)); repository.GuardAgainstNull(nameof(repository)); this.carQueryStorage = new GeneralQueryStorage <Car>(recorder, domainFactory, repository); this.carEventStreamStorage = eventStreamStorage; this.unavailabilitiesQueryStorage = new GeneralQueryStorage <Unavailability>(recorder, domainFactory, repository); }
public ClinicStorage(ILogger logger, IDomainFactory domainFactory, IEventStreamStorage <ClinicEntity> eventStreamStorage, IRepository repository) { logger.GuardAgainstNull(nameof(logger)); domainFactory.GuardAgainstNull(nameof(domainFactory)); eventStreamStorage.GuardAgainstNull(nameof(eventStreamStorage)); repository.GuardAgainstNull(nameof(repository)); this.doctorQueryStorage = new GeneralQueryStorage <Doctor>(logger, domainFactory, repository); this.clinicEventStreamStorage = eventStreamStorage; this.unavailabilitiesQueryStorage = new GeneralQueryStorage <Unavailability>(logger, domainFactory, repository); }
public CallbackNumbersController(IDomainFactory domainFactory) { _domainFactory = domainFactory; }
public override void Init() { IOOSourceCodeDomainSoapBinding exampleDomain = new OOSourceCodeDomainConnector(); factory = DomainFactoryProvider.GetDomainFactoryInstance("3.0.0", Destination, exampleDomain, new ForwardDefaultExceptionHandler()); }
public ServiceConnectorManager() { _configurations = null; _domainFactory = DomainFactoryProvider.GetDomainFactoryInstance(); _State = State.DISCONNECTED; }