public void test_DartModelImpl_getDartProject_string() { DartModelImpl model = new DartModelImpl(); String projectName = "testProject"; DartProject project = model.getDartProject(projectName); assertNotNull(project); assertEquals(projectName, project.getProject().getName()); }
public void test_DartModelImpl_getDartProject_project() { DartModelImpl model = new DartModelImpl(); IProject project = new MockProject(); DartProject dartProject = model.getDartProject(project); assertNotNull(dartProject); assertEquals(project, dartProject.getProject()); }
public void test_DartModelManager_create_file_exist() throws Exception { DartProject moneyProject = MoneyProjectUtilities.getMoneyProject(); IFile file = moneyProject.getProject().getFile("money.dart"); DartElementImpl element = DartModelManager.getInstance().create(file); assertNotNull(element); assertTrue(element instanceof CompilationUnitImpl); assertTrue(element.exists()); }
public static void deleteProject(final DartProject project) { try { project .getProject() .getWorkspace() .run( new IWorkspaceRunnable() { @Override public void run(IProgressMonitor monitor) throws CoreException { deleteProject(project.getProject()); } }, null); } catch (CoreException exception) { // DartCore.getLogger().logError(exception, "Could not delete the project " + // project.getElementName()); //$NON-NLS-1$ } }
public void test_DartModelManager_create_file_nonExist() throws Exception { DartProject moneyProject = MoneyProjectUtilities.getMoneyProject(); IFile file = moneyProject.getProject().getFile("doesNotExist.dart"); DartElementImpl element = DartModelManager.getInstance().create(file); assertNull(element); }