Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use convenience methods for notifications for SDLRPCNotifications and SDLRPCResponses validation #553

Closed
asm09fsu opened this issue Mar 1, 2017 · 0 comments
Milestone

Comments

@asm09fsu
Copy link
Contributor

asm09fsu commented Mar 1, 2017

Bug Report

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.

@asm09fsu asm09fsu added this to the 5.0.0 milestone Mar 1, 2017
@asm09fsu 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants