Loading android/app/tests/unit/src/com/android/bluetooth/avrcpcontroller/AvrcpCoverArtStorageTest.java +11 −0 Original line number Diff line number Diff line Loading @@ -329,4 +329,15 @@ public final class AvrcpCoverArtStorageTest { Assert.assertFalse(mAvrcpCoverArtStorage.doesImageExist(mDevice2, mHandle1)); Assert.assertFalse(mAvrcpCoverArtStorage.doesImageExist(mDevice2, mHandle2)); } @Test public void toString_returnsDeviceInfo() { String expectedString = "CoverArtStorage:\n" + " " + mDevice1.getAddress() + " (" + 1 + "):" + "\n " + mHandle1 + "\n"; mAvrcpCoverArtStorage.addImage(mDevice1, mHandle1, mImage1); Assert.assertEquals(expectedString, mAvrcpCoverArtStorage.toString()); } } android/app/tests/unit/src/com/android/bluetooth/avrcpcontroller/AvrcpItemTest.java +30 −0 Original line number Diff line number Diff line Loading @@ -639,4 +639,34 @@ public final class AvrcpItemTest { Assert.assertEquals(uri, desc.getIconUri()); Assert.assertEquals(null, desc.getIconBitmap()); } @Test public void equals_withItself() { AvrcpItem.Builder builder = new AvrcpItem.Builder(); AvrcpItem item = builder.build(); Assert.assertTrue(item.equals(item)); } @Test public void equals_withDifferentInstance() { AvrcpItem.Builder builder = new AvrcpItem.Builder(); String notAvrcpItem = "notAvrcpItem"; AvrcpItem item = builder.build(); Assert.assertFalse(item.equals(notAvrcpItem)); } @Test public void equals_withItemContainingSameInfo() { AvrcpItem.Builder builder = new AvrcpItem.Builder(); AvrcpItem.Builder builderEqual = new AvrcpItem.Builder(); AvrcpItem item = builder.build(); AvrcpItem itemEqual = builderEqual.build(); Assert.assertTrue(item.equals(itemEqual)); } } android/app/tests/unit/src/com/android/bluetooth/avrcpcontroller/bip/BipAttachmentFormatTest.java +35 −8 Original line number Diff line number Diff line Loading @@ -289,4 +289,31 @@ public class BipAttachmentFormatTest { null); Assert.assertEquals(expectedRequiredOnly, attachment.toString()); } @Test public void testEquals_withSameInstance() { BipAttachmentFormat attachment = new BipAttachmentFormat("text/plain", null, "thisisatextfile.txt", -1, null, null); Assert.assertTrue(attachment.equals(attachment)); } @Test public void testEquals_withDifferentClass() { BipAttachmentFormat attachment = new BipAttachmentFormat("text/plain", null, "thisisatextfile.txt", -1, null, null); String notAttachment = "notAttachment"; Assert.assertFalse(attachment.equals(notAttachment)); } @Test public void testEquals_withSameInfo() { BipAttachmentFormat attachment = new BipAttachmentFormat("text/plain", null, "thisisatextfile.txt", -1, null, null); BipAttachmentFormat attachmentEqual = new BipAttachmentFormat("text/plain", null, "thisisatextfile.txt", -1, null, null); Assert.assertTrue(attachment.equals(attachmentEqual)); } } android/app/tests/unit/src/com/android/bluetooth/avrcpcontroller/bip/BipDatetimeTest.java +36 −3 Original line number Diff line number Diff line Loading @@ -176,4 +176,37 @@ public class BipDatetimeTest { testCreate(makeDate(1, 1, 2000, 23, 59, 59, utc), "20000101T235959Z"); testCreate(makeDate(11, 27, 2050, 23, 59, 59, utc), "20501127T235959Z"); } @Test public void testEquals_withSameInstance() { TimeZone utc = TimeZone.getTimeZone("UTC"); utc.setRawOffset(0); BipDateTime bipDate = new BipDateTime(makeDate(1, 1, 2000, 6, 1, 15, utc)); Assert.assertTrue(bipDate.equals(bipDate)); } @Test public void testEquals_withDifferentClass() { TimeZone utc = TimeZone.getTimeZone("UTC"); utc.setRawOffset(0); BipDateTime bipDate = new BipDateTime(makeDate(1, 1, 2000, 6, 1, 15, utc)); String notBipDate = "notBipDate"; Assert.assertFalse(bipDate.equals(notBipDate)); } @Test public void testEquals_withSameInfo() { TimeZone utc = TimeZone.getTimeZone("UTC"); utc.setRawOffset(0); Date date = makeDate(1, 1, 2000, 6, 1, 15, utc); BipDateTime bipDate = new BipDateTime(date); BipDateTime bipDateEqual = new BipDateTime(date); Assert.assertTrue(bipDate.equals(bipDateEqual)); } } android/app/tests/unit/src/com/android/bluetooth/avrcpcontroller/bip/BipImageDescriptorTest.java +30 −0 Original line number Diff line number Diff line Loading @@ -216,4 +216,34 @@ public class BipImageDescriptorTest { BipImageDescriptor descriptor = builder.build(); Assert.assertEquals(null, descriptor.toString()); } @Test public void testEquals_sameInstance() { BipImageDescriptor.Builder builder = new BipImageDescriptor.Builder(); BipImageDescriptor descriptor = builder.build(); Assert.assertTrue(descriptor.equals(descriptor)); } @Test public void testEquals_differentClass() { BipImageDescriptor.Builder builder = new BipImageDescriptor.Builder(); BipImageDescriptor descriptor = builder.build(); String notDescriptor = "notDescriptor"; Assert.assertFalse(descriptor.equals(notDescriptor)); } @Test public void testEquals_sameInfo() { BipImageDescriptor.Builder builder = new BipImageDescriptor.Builder(); BipImageDescriptor.Builder builderEqual = new BipImageDescriptor.Builder(); BipImageDescriptor descriptor = builder.build(); BipImageDescriptor descriptorEqual = builderEqual.build(); Assert.assertTrue(descriptor.equals(descriptorEqual)); } } Loading
android/app/tests/unit/src/com/android/bluetooth/avrcpcontroller/AvrcpCoverArtStorageTest.java +11 −0 Original line number Diff line number Diff line Loading @@ -329,4 +329,15 @@ public final class AvrcpCoverArtStorageTest { Assert.assertFalse(mAvrcpCoverArtStorage.doesImageExist(mDevice2, mHandle1)); Assert.assertFalse(mAvrcpCoverArtStorage.doesImageExist(mDevice2, mHandle2)); } @Test public void toString_returnsDeviceInfo() { String expectedString = "CoverArtStorage:\n" + " " + mDevice1.getAddress() + " (" + 1 + "):" + "\n " + mHandle1 + "\n"; mAvrcpCoverArtStorage.addImage(mDevice1, mHandle1, mImage1); Assert.assertEquals(expectedString, mAvrcpCoverArtStorage.toString()); } }
android/app/tests/unit/src/com/android/bluetooth/avrcpcontroller/AvrcpItemTest.java +30 −0 Original line number Diff line number Diff line Loading @@ -639,4 +639,34 @@ public final class AvrcpItemTest { Assert.assertEquals(uri, desc.getIconUri()); Assert.assertEquals(null, desc.getIconBitmap()); } @Test public void equals_withItself() { AvrcpItem.Builder builder = new AvrcpItem.Builder(); AvrcpItem item = builder.build(); Assert.assertTrue(item.equals(item)); } @Test public void equals_withDifferentInstance() { AvrcpItem.Builder builder = new AvrcpItem.Builder(); String notAvrcpItem = "notAvrcpItem"; AvrcpItem item = builder.build(); Assert.assertFalse(item.equals(notAvrcpItem)); } @Test public void equals_withItemContainingSameInfo() { AvrcpItem.Builder builder = new AvrcpItem.Builder(); AvrcpItem.Builder builderEqual = new AvrcpItem.Builder(); AvrcpItem item = builder.build(); AvrcpItem itemEqual = builderEqual.build(); Assert.assertTrue(item.equals(itemEqual)); } }
android/app/tests/unit/src/com/android/bluetooth/avrcpcontroller/bip/BipAttachmentFormatTest.java +35 −8 Original line number Diff line number Diff line Loading @@ -289,4 +289,31 @@ public class BipAttachmentFormatTest { null); Assert.assertEquals(expectedRequiredOnly, attachment.toString()); } @Test public void testEquals_withSameInstance() { BipAttachmentFormat attachment = new BipAttachmentFormat("text/plain", null, "thisisatextfile.txt", -1, null, null); Assert.assertTrue(attachment.equals(attachment)); } @Test public void testEquals_withDifferentClass() { BipAttachmentFormat attachment = new BipAttachmentFormat("text/plain", null, "thisisatextfile.txt", -1, null, null); String notAttachment = "notAttachment"; Assert.assertFalse(attachment.equals(notAttachment)); } @Test public void testEquals_withSameInfo() { BipAttachmentFormat attachment = new BipAttachmentFormat("text/plain", null, "thisisatextfile.txt", -1, null, null); BipAttachmentFormat attachmentEqual = new BipAttachmentFormat("text/plain", null, "thisisatextfile.txt", -1, null, null); Assert.assertTrue(attachment.equals(attachmentEqual)); } }
android/app/tests/unit/src/com/android/bluetooth/avrcpcontroller/bip/BipDatetimeTest.java +36 −3 Original line number Diff line number Diff line Loading @@ -176,4 +176,37 @@ public class BipDatetimeTest { testCreate(makeDate(1, 1, 2000, 23, 59, 59, utc), "20000101T235959Z"); testCreate(makeDate(11, 27, 2050, 23, 59, 59, utc), "20501127T235959Z"); } @Test public void testEquals_withSameInstance() { TimeZone utc = TimeZone.getTimeZone("UTC"); utc.setRawOffset(0); BipDateTime bipDate = new BipDateTime(makeDate(1, 1, 2000, 6, 1, 15, utc)); Assert.assertTrue(bipDate.equals(bipDate)); } @Test public void testEquals_withDifferentClass() { TimeZone utc = TimeZone.getTimeZone("UTC"); utc.setRawOffset(0); BipDateTime bipDate = new BipDateTime(makeDate(1, 1, 2000, 6, 1, 15, utc)); String notBipDate = "notBipDate"; Assert.assertFalse(bipDate.equals(notBipDate)); } @Test public void testEquals_withSameInfo() { TimeZone utc = TimeZone.getTimeZone("UTC"); utc.setRawOffset(0); Date date = makeDate(1, 1, 2000, 6, 1, 15, utc); BipDateTime bipDate = new BipDateTime(date); BipDateTime bipDateEqual = new BipDateTime(date); Assert.assertTrue(bipDate.equals(bipDateEqual)); } }
android/app/tests/unit/src/com/android/bluetooth/avrcpcontroller/bip/BipImageDescriptorTest.java +30 −0 Original line number Diff line number Diff line Loading @@ -216,4 +216,34 @@ public class BipImageDescriptorTest { BipImageDescriptor descriptor = builder.build(); Assert.assertEquals(null, descriptor.toString()); } @Test public void testEquals_sameInstance() { BipImageDescriptor.Builder builder = new BipImageDescriptor.Builder(); BipImageDescriptor descriptor = builder.build(); Assert.assertTrue(descriptor.equals(descriptor)); } @Test public void testEquals_differentClass() { BipImageDescriptor.Builder builder = new BipImageDescriptor.Builder(); BipImageDescriptor descriptor = builder.build(); String notDescriptor = "notDescriptor"; Assert.assertFalse(descriptor.equals(notDescriptor)); } @Test public void testEquals_sameInfo() { BipImageDescriptor.Builder builder = new BipImageDescriptor.Builder(); BipImageDescriptor.Builder builderEqual = new BipImageDescriptor.Builder(); BipImageDescriptor descriptor = builder.build(); BipImageDescriptor descriptorEqual = builderEqual.build(); Assert.assertTrue(descriptor.equals(descriptorEqual)); } }