public void SetNullSource() { ProjectTestClass project = new ProjectTestClass(); IProjectEventsProvider eventProvider = project as IProjectEventsProvider; Assert.IsNotNull(eventProvider, "Project class does not implements IProjectEventsProvider."); eventProvider.ProjectEventsProvider = null; project.Close(); }
public void SetNullSource() { ProjectTestClass project = new ProjectTestClass(new ProjectTestPackage()); IProjectEventsProvider eventProvider = project as IProjectEventsProvider; Assert.IsNotNull(eventProvider, "Project class does not implements IProjectEventsProvider."); eventProvider.ProjectEventsProvider = null; project.Close(); }
public void SetOpenStatusTest() { using (ProjectEventsSource eventSource = new ProjectEventsSource()) { ProjectTestClass project = new ProjectTestClass(new ProjectTestPackage()); IProjectEventsProvider eventProvider = project as IProjectEventsProvider; Assert.IsNotNull(eventProvider, "Project class does not implements IProjectEventsProvider."); Assert.IsFalse(IsProjectOpened(project), "Project is opened right after its creation."); eventProvider.ProjectEventsProvider = eventSource; eventSource.SignalOpenStatus(true); Assert.IsTrue(IsProjectOpened(project), "Project is not opened after the AfterProjectFileOpened is signaled."); project.Close(); } }
public void SetOpenStatusTest() { using(ProjectEventsSource eventSource = new ProjectEventsSource()) { ProjectTestClass project = new ProjectTestClass(); IProjectEventsProvider eventProvider = project as IProjectEventsProvider; Assert.IsNotNull(eventProvider, "Project class does not implements IProjectEventsProvider."); Assert.IsFalse(IsProjectOpened(project), "Project is opened right after its creation."); eventProvider.ProjectEventsProvider = eventSource; eventSource.SignalOpenStatus(true); Assert.IsTrue(IsProjectOpened(project), "Project is not opened after the AfterProjectFileOpened is signaled."); project.Close(); } }
public void SetMultipleSource() { using (ProjectEventsSource firstSource = new ProjectEventsSource()) { using (ProjectEventsSource secondSource = new ProjectEventsSource()) { ProjectTestClass project = new ProjectTestClass(new ProjectTestPackage()); IProjectEventsProvider eventProvider = project as IProjectEventsProvider; Assert.IsNotNull(eventProvider, "Project class does not implements IProjectEventsProvider."); eventProvider.ProjectEventsProvider = firstSource; eventProvider.ProjectEventsProvider = secondSource; Assert.IsFalse(IsProjectOpened(project)); firstSource.SignalOpenStatus(true); Assert.IsFalse(IsProjectOpened(project)); secondSource.SignalOpenStatus(true); Assert.IsTrue(IsProjectOpened(project)); project.Close(); } } }
public void SetMultipleSource() { using(ProjectEventsSource firstSource = new ProjectEventsSource()) { using(ProjectEventsSource secondSource = new ProjectEventsSource()) { ProjectTestClass project = new ProjectTestClass(); IProjectEventsProvider eventProvider = project as IProjectEventsProvider; Assert.IsNotNull(eventProvider, "Project class does not implements IProjectEventsProvider."); eventProvider.ProjectEventsProvider = firstSource; eventProvider.ProjectEventsProvider = secondSource; Assert.IsFalse(IsProjectOpened(project)); firstSource.SignalOpenStatus(true); Assert.IsFalse(IsProjectOpened(project)); secondSource.SignalOpenStatus(true); Assert.IsTrue(IsProjectOpened(project)); project.Close(); } } }