コード例 #1
0
 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();
     }
 }
コード例 #2
0
 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();
     }
 }
コード例 #3
0
 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();
         }
     }
 }
コード例 #4
0
 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();
         }
     }
 }