Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(15)

Unified Diff: third_party/ocmock/OCMock/OCObserverMockObjectTest.m

Issue 9240023: Roll OCMock r77:7f521db0628086185123666b0979e48d6ecaeac1. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/ocmock/OCMock/OCObserverMockObjectTest.m
diff --git a/third_party/ocmock/OCMock/OCObserverMockObjectTest.m b/third_party/ocmock/OCMock/OCObserverMockObjectTest.m
deleted file mode 100644
index b0584345d379e9c7b8f7a9544a9de5e13e016089..0000000000000000000000000000000000000000
--- a/third_party/ocmock/OCMock/OCObserverMockObjectTest.m
+++ /dev/null
@@ -1,127 +0,0 @@
-//---------------------------------------------------------------------------------------
-// $Id: OCObserverMockObjectTest.m 57 2010-07-19 06:14:27Z erik $
-// Copyright (c) 2009 by Mulle Kybernetik. See License file for details.
-//---------------------------------------------------------------------------------------
-
-#import <OCMock/OCMock.h>
-#import "OCObserverMockObjectTest.h"
-
-static NSString *TestNotificationOne = @"TestNotificationOne";
-
-
-@implementation OCObserverMockObjectTest
-
-- (void)setUp
-{
- center = [[[NSNotificationCenter alloc] init] autorelease];
- mock = [OCMockObject observerMock];
-}
-
-- (void)testAcceptsExpectedNotification
-{
- [center addMockObserver:mock name:TestNotificationOne object:nil];
- [[mock expect] notificationWithName:TestNotificationOne object:[OCMArg any]];
-
- [center postNotificationName:TestNotificationOne object:self];
-
- [mock verify];
-}
-
-- (void)testAcceptsExpectedNotificationWithSpecifiedObjectAndUserInfo
-{
- [center addMockObserver:mock name:TestNotificationOne object:nil];
- NSDictionary *info = [NSDictionary dictionaryWithObject:@"foo" forKey:@"key"];
- [[mock expect] notificationWithName:TestNotificationOne object:self userInfo:info];
-
- [center postNotificationName:TestNotificationOne object:self userInfo:info];
-
- [mock verify];
-}
-
-- (void)testAcceptsNotificationsInAnyOrder
-{
- [center addMockObserver:mock name:TestNotificationOne object:nil];
- [[mock expect] notificationWithName:TestNotificationOne object:self];
- [[mock expect] notificationWithName:TestNotificationOne object:[OCMArg any]];
-
- [center postNotificationName:TestNotificationOne object:[NSString string]];
- [center postNotificationName:TestNotificationOne object:self];
-}
-
-- (void)testAcceptsNotificationsInCorrectOrderWhenOrderMatters
-{
- [mock setExpectationOrderMatters:YES];
-
- [center addMockObserver:mock name:TestNotificationOne object:nil];
- [[mock expect] notificationWithName:TestNotificationOne object:self];
- [[mock expect] notificationWithName:TestNotificationOne object:[OCMArg any]];
-
- [center postNotificationName:TestNotificationOne object:self];
- [center postNotificationName:TestNotificationOne object:[NSString string]];
-}
-
-- (void)testRaisesExceptionWhenSequenceIsWrongAndOrderMatters
-{
- [mock setExpectationOrderMatters:YES];
-
- [center addMockObserver:mock name:TestNotificationOne object:nil];
- [[mock expect] notificationWithName:TestNotificationOne object:self];
- [[mock expect] notificationWithName:TestNotificationOne object:[OCMArg any]];
-
- STAssertThrows([center postNotificationName:TestNotificationOne object:[NSString string]], @"Should have complained about sequence.");
-}
-
-- (void)testRaisesEvenThoughOverlappingExpectationsCouldHaveBeenSatisfied
-{
- // this test demonstrates a shortcoming, not a feature
- [center addMockObserver:mock name:TestNotificationOne object:nil];
- [[mock expect] notificationWithName:TestNotificationOne object:[OCMArg any]];
- [[mock expect] notificationWithName:TestNotificationOne object:self];
-
- [center postNotificationName:TestNotificationOne object:self];
- STAssertThrows([center postNotificationName:TestNotificationOne object:[NSString string]], nil);
-}
-
-- (void)testRaisesExceptionWhenUnexpectedNotificationIsReceived
-{
- [center addMockObserver:mock name:TestNotificationOne object:nil];
-
- STAssertThrows([center postNotificationName:TestNotificationOne object:self], nil);
-}
-
-- (void)testRaisesWhenNotificationWithWrongObjectIsReceived
-{
- [center addMockObserver:mock name:TestNotificationOne object:nil];
- [[mock expect] notificationWithName:TestNotificationOne object:self];
-
- STAssertThrows([center postNotificationName:TestNotificationOne object:[NSString string]], nil);
-}
-
-- (void)testRaisesWhenNotificationWithWrongUserInfoIsReceived
-{
- [center addMockObserver:mock name:TestNotificationOne object:nil];
- [[mock expect] notificationWithName:TestNotificationOne object:self
- userInfo:[NSDictionary dictionaryWithObject:@"foo" forKey:@"key"]];
- STAssertThrows([center postNotificationName:TestNotificationOne object:[NSString string]
- userInfo:[NSDictionary dictionaryWithObject:@"bar" forKey:@"key"]], nil);
-}
-
-- (void)testRaisesOnVerifyWhenExpectedNotificationIsNotSent
-{
- [center addMockObserver:mock name:TestNotificationOne object:nil];
- [[mock expect] notificationWithName:TestNotificationOne object:[OCMArg any]];
-
- STAssertThrows([mock verify], nil);
-}
-
-- (void)testRaisesOnVerifyWhenNotAllNotificationsWereSent
-{
- [center addMockObserver:mock name:TestNotificationOne object:nil];
- [[mock expect] notificationWithName:TestNotificationOne object:[OCMArg any]];
- [[mock expect] notificationWithName:TestNotificationOne object:self];
-
- [center postNotificationName:TestNotificationOne object:self];
- STAssertThrows([mock verify], nil);
-}
-
-@end
« no previous file with comments | « third_party/ocmock/OCMock/OCObserverMockObjectTest.h ('k') | third_party/ocmock/OCMock/OCPartialMockObject.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698