You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, we rely on the same code throughout the library for validating notifications we receive (both SDLRPCNotification and SDLRPCResponse).
NSAssert([notification.userInfo[SDLNotificationUserInfoObject] isKindOfClass:[SDLOnHMIStatus class]], @"A notification was sent with an unanticipated object");
if (![notification.userInfo[SDLNotificationUserInfoObject] isKindOfClass:[SDLOnHMIStatus class]]) {
return;
}
We should add this as functions onto both classes to provide an easy way for us to validate internally, but also for developers to validate externally.
Also, this will give us the opportunity to update all uses of notification.userInfo[SDLNotificationUserInfoObject] to the convenience method notification.notification or notification.response for both classes, as we should have done from the beginning.
We are also not correctly constructing the tests appropriately for sending out notifications. We should be sending out SDLRPCNotificationNotification and SDLRPCResponseNotification objects for tests, however we are currently using NSNotification object.
The text was updated successfully, but these errors were encountered:
asm09fsu
changed the title
Use convenience methods for notifications for SDLRPCNotifications and SDLRPCResponses
Use convenience methods for notifications for SDLRPCNotifications and SDLRPCResponses validation
Mar 1, 2017
Bug Report
Currently, we rely on the same code throughout the library for validating notifications we receive (both
SDLRPCNotification
andSDLRPCResponse
).We should add this as functions onto both classes to provide an easy way for us to validate internally, but also for developers to validate externally.
Also, this will give us the opportunity to update all uses of
notification.userInfo[SDLNotificationUserInfoObject]
to the convenience methodnotification.notification
ornotification.response
for both classes, as we should have done from the beginning.We are also not correctly constructing the tests appropriately for sending out notifications. We should be sending out
SDLRPCNotificationNotification
andSDLRPCResponseNotification
objects for tests, however we are currently usingNSNotification
object.The text was updated successfully, but these errors were encountered: