OCFileTest.java 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. /*
  2. *
  3. * Nextcloud Android client application
  4. *
  5. * @author Tobias Kaminsky
  6. * Copyright (C) 2021 Tobias Kaminsky
  7. * Copyright (C) 2021 Nextcloud GmbH
  8. *
  9. * This program is free software: you can redistribute it and/or modify
  10. * it under the terms of the GNU Affero General Public License as published by
  11. * the Free Software Foundation, either version 3 of the License, or
  12. * (at your option) any later version.
  13. *
  14. * This program is distributed in the hope that it will be useful,
  15. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  16. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  17. * GNU Affero General Public License for more details.
  18. *
  19. * You should have received a copy of the GNU Affero General Public License
  20. * along with this program. If not, see <https://www.gnu.org/licenses/>.
  21. */
  22. package com.owncloud.android.datamodel;
  23. import org.junit.Test;
  24. import static org.junit.Assert.assertEquals;
  25. public class OCFileTest {
  26. @Test
  27. public void testLongIds() {
  28. OCFile sut = new OCFile("/", "12345678ocjycgrudn78");
  29. assertEquals("12345678", sut.getLocalId());
  30. sut.setRemoteId("00000008ocjycgrudn78");
  31. assertEquals("8", sut.getLocalId());
  32. sut.setRemoteId("1234567891011ocjycgrudn78");
  33. assertEquals("1234567891011", sut.getLocalId());
  34. }
  35. }