public ProjectWorkflowWrapper(ProjectWorkflow workflow, IUnitsOfWorkContainer unitsOfWork) { _workflow = workflow; _unitsOfWork = unitsOfWork; //Entry Methods Binding BindEntryMethods(); //Exit Methods Binding BindExitMethods(); //Guard For Transitions BindGuardMethods(); }
private ProjectStateManager(Project currentProject, string currentUser, IList <string> roles) { _currentUser = currentUser; _roles = roles; _investorNotificate = new InvestorNotification(); _adminNotificate = new AdminNotification(); _userNotificationl = new UserNotification(); _repository = RepositoryContext.Current; _currentProject = _repository.GetOne <Project>(p => p._id == currentProject._id); _unitsOfWork = new UnitsOfWorkContainer(_currentProject, _repository, _userNotificationl, _adminNotificate, _investorNotificate, _currentUser, _roles); if (_currentProject == null) { _currentProject = currentProject; } if (string.IsNullOrEmpty(_currentProject._id)) { _currentProject._id = ObjectId.GenerateNewId().ToString(); } if (_currentProject.WorkflowState == null) { _currentProject.WorkflowState = new Workflow { CurrentState = ProjectWorkflow.State.Open }; } _workflow = new ProjectWorkflowWrapper(new ProjectWorkflow(_currentProject.WorkflowState.CurrentState), _unitsOfWork); /*var context = new ProjectStateContext * { * UserName = currentUser, * CurrentProject = currentProject, * Roles = roles, * InvestorNotification = _investorNotificate, * UserNotification = _userNotificationl, * AdminNotification = _adminNotificate, * Repository = _repository * }; * var builder = new AttributeStateMachineBuilder(); * _workflow = new ProjectWorkflowWrapper( * new ProjectWorkflow( * builder.BuilStateMachine<ProjectWorkflow.State,ProjectWorkflow.Trigger>("test", context,_currentProject.WorkflowState.CurrentState)));*/ }
public void ComissionFixesUoWTest() { IUnitsOfWorkContainer container = CreateCintainer(); Assert.IsNotNull(container.ComissionFixesUoW); }
public void WaitIspolcomUoWTest() { IUnitsOfWorkContainer container = CreateCintainer(); Assert.IsNotNull(container.WaitIspolcomUoW); }
public void UnitsOfWorkContainerConstructorTest() { IUnitsOfWorkContainer target = CreateCintainer(); Assert.IsNotNull(target); }
public void RealizationUoWTest() { IUnitsOfWorkContainer container = CreateCintainer(); Assert.IsNotNull(container.RealizationUoW); }
public void PlanCreatingUoWTest() { IUnitsOfWorkContainer container = CreateCintainer(); Assert.IsNotNull(container.PlanCreatingUoW); }
public void OpenUoWTest() { IUnitsOfWorkContainer container = CreateCintainer(); Assert.IsNotNull(container.OpenUoW); }
public void MinEconomyUoWTest() { IUnitsOfWorkContainer container = CreateCintainer(); Assert.IsNotNull(container.MinEconomyUoW); }
public void InvolvedorganizationsUoWTest() { IUnitsOfWorkContainer container = CreateCintainer(); Assert.IsNotNull(container.InvolvedorganizationsUoW); }
public void InvestorApproveUoWTest() { IUnitsOfWorkContainer container = CreateCintainer(); Assert.IsNotNull(container.InvestorApproveUoW); }
public void DocumentSendingUoWTest() { IUnitsOfWorkContainer container = CreateCintainer(); Assert.IsNotNull(container.DocumentSendingUoW); }