Repositorio del curso CCOM4030 el semestre B91 del proyecto Paz para la Mujer

CDVCommandDelegateTests.m 1.6KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. /*
  2. Licensed to the Apache Software Foundation (ASF) under one
  3. or more contributor license agreements. See the NOTICE file
  4. distributed with this work for additional information
  5. regarding copyright ownership. The ASF licenses this file
  6. to you under the Apache License, Version 2.0 (the
  7. "License"); you may not use this file except in compliance
  8. with the License. You may obtain a copy of the License at
  9. http://www.apache.org/licenses/LICENSE-2.0
  10. Unless required by applicable law or agreed to in writing,
  11. software distributed under the License is distributed on an
  12. "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  13. KIND, either express or implied. See the License for the
  14. specific language governing permissions and limitations
  15. under the License.
  16. */
  17. #import <XCTest/XCTest.h>
  18. #import <Cordova/CDVCommandDelegateImpl.h>
  19. @interface CDVCommandDelegateTests : XCTestCase
  20. @end
  21. @interface CDVCommandDelegateImpl ()
  22. // expose private interface
  23. - (BOOL)isValidCallbackId:(NSString*)callbackId;
  24. @end
  25. @implementation CDVCommandDelegateTests
  26. - (void)setUp
  27. {
  28. [super setUp];
  29. // Put setup code here. This method is called before the invocation of each test method in the class.
  30. }
  31. - (void)tearDown
  32. {
  33. // Put teardown code here. This method is called after the invocation of each test method in the class.
  34. [super tearDown];
  35. }
  36. - (void)testNullCallbackId
  37. {
  38. CDVCommandDelegateImpl* impl = [[CDVCommandDelegateImpl alloc] initWithViewController:nil];
  39. NSString* callbackId = nil;
  40. XCTAssertFalse([impl isValidCallbackId:callbackId], @"A nil callbackId should be not valid");
  41. }
  42. @end