How to mock a Android NFC Tag object for unit testing

后端 未结 2 845
太阳男子
太阳男子 2020-12-16 03:16

I\'m currently working on an Android project which needs NFC integration. Now I want to write some (j)unit tests to see if the application can receive NFC intents (specifica

2条回答
  •  既然无缘
    2020-12-16 03:47

    I don't think it is possible to mock these intents as these are fired by NFCService and without system permissions it is not possible to fire these intents and currently there is not support in the android framework to mock nfc tags.

提交回复
热议问题