Unit Test case bundle for PacketTunnelProvider

Hello

As we know that PacketTunnelProvider is a network extension with parent class as NEPacketTunnelProvider.

Is it possible to write a test suit bundle for the PacketTunnelProvider ?

We already know that we can not check the VPN functionality on a simulator. It is only possible on hardware device.

Please help to answer my query.

Thanks.

Unit testing your top-level packet tunnel provider class — that is, your subclass of NEPacketTunnelProvider — isn’t really feasible. But it also doesn’t really make much sense. A unit test is supposed to test one class in isolation, but all the interesting stuff about a packet tunnel provider is in its integration with the OS. A test for that would be an integration tests.

My advice on this front is to structure your code so that all its core functionality exists in separate types and then write unit tests for those types.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

Unit Test case bundle for PacketTunnelProvider
 
 
Q