コード例 #1
0
 @Test
 public void testNotExisting() throws IOException, InterruptedException {
   RestApi.Folder r = new RestApi.Folder();
   r.path =
       new File(
               new MockContext(InstrumentationRegistry.getTargetContext()).getFilesDir(),
               "not-existing")
           .getPath();
   r.id = "testNotExisting";
   try {
     new FolderObserver(this, r);
     Assert.fail("Expected FolderNotExistingException");
   } catch (FolderObserver.FolderNotExistingException e) {
     Assert.assertTrue(e.getMessage().contains(r.path));
   }
 }
コード例 #2
0
 private RestApi.Folder createFolder(String id) {
   RestApi.Folder r = new RestApi.Folder();
   r.path = mTestFolder.getPath();
   r.id = id;
   return r;
 }