예제 #1
0
        public void ImportModule_Cancel()
        {
            const string path = @"C:\Users\Rubberduck\Desktop\StdModule1.bas";

            using (var explorer = new MockedCodeExplorer(ProjectType.HostProject)
                                  .ConfigureOpenDialog(new[] { path }, DialogResult.Cancel)
                                  .SelectFirstProject())
            {
                explorer.ExecuteImportCommand();
                explorer.VbComponents.Verify(c => c.Import(path), Times.Never);
            }
        }
예제 #2
0
        public void ImportMultipleModules()
        {
            const string path1 = @"C:\Users\Rubberduck\Desktop\StdModule1.bas";
            const string path2 = @"C:\Users\Rubberduck\Desktop\ClsModule1.bas";

            using (var explorer = new MockedCodeExplorer(ProjectType.HostProject)
                                  .ConfigureOpenDialog(new[] { path1, path2 }, DialogResult.OK)
                                  .SelectFirstProject())
            {
                explorer.ExecuteImportCommand();
                explorer.VbComponents.Verify(c => c.Import(path1), Times.Once);
                explorer.VbComponents.Verify(c => c.Import(path2), Times.Once);
            }
        }