void OpenProjectById(Guid projectId) { NewProjectUseCase newProjectUseCase = this.Container.Resolve <NewProjectUseCase>(); newProjectUseCase.ProjectId = projectId; ApplicationModel.AddMainUseCase(newProjectUseCase); ApplicationModel.ActivateUseCase(newProjectUseCase); }
void OpenResourceById(int resourceId) { NewResourceUseCase newResourceUseCase = this.Container.Resolve <NewResourceUseCase>(); newResourceUseCase.ResourceId = resourceId; ApplicationModel.AddMainUseCase(newResourceUseCase); ApplicationModel.ActivateUseCase(newResourceUseCase); }
public void ActivatingOneUseCaseDeactivatesOther() { ApplicationModel applicationModel = CreateApplicationModel(); IActiveAwareUseCaseController mockUseCase1 = new MockUseCase(); IActiveAwareUseCaseController mockUseCase2 = new MockUseCase(); applicationModel.AddMainUseCase(mockUseCase1); applicationModel.AddMainUseCase(mockUseCase2); Assert.IsFalse(mockUseCase1.IsActive); Assert.AreEqual(0, applicationModel.ActiveUseCases.Count()); applicationModel.ActivateUseCase(mockUseCase1); Assert.AreEqual(mockUseCase1, applicationModel.ActiveUseCases.FirstOrDefault()); Assert.IsTrue(mockUseCase1.IsActive); applicationModel.ActivateUseCase(mockUseCase2); Assert.AreEqual(mockUseCase2, applicationModel.ActiveUseCases.FirstOrDefault()); Assert.IsTrue(mockUseCase2.IsActive); Assert.IsFalse(mockUseCase1.IsActive); }