Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions MulticastDelegateDemo/DemoService.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
//

import Foundation
import MulticastDelegateDemo

protocol DemoServiceDelegate {

Expand Down
29 changes: 25 additions & 4 deletions MulticastDelegateDemoTests/MulticastDelegateDemoTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -291,21 +291,42 @@ class MulticastDelegateDemoTests: XCTestCase {
XCTAssertTrue(multicastDelegate.isEmpty)
}

func testNotEmptyAfterAdd() {
func testNotEmptyAfterAddtrongReference() {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typo in strong

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

omg... I'm sorry about that. I have the correction coming soon.


let multicastDelegate = MulticastDelegate<TestDelegate>()
multicastDelegate += DelegateTestClass()
let delegate1 = DelegateTestClass()
multicastDelegate += delegate1

Comment thread
coachroebuck marked this conversation as resolved.
Outdated
XCTAssertFalse(multicastDelegate.isEmpty)
}

Comment thread
coachroebuck marked this conversation as resolved.
Outdated
func testNotEmptyAfterDoubleAddStrongReferences() {

Comment thread
coachroebuck marked this conversation as resolved.
Outdated
let multicastDelegate = MulticastDelegate<TestDelegate>()
let delegate1 = DelegateTestClass()
let delegate2 = DelegateTestClass()
multicastDelegate += delegate1
multicastDelegate += delegate2

XCTAssertFalse(multicastDelegate.isEmpty)
}

func testNotEmptyAfterDoubleAdd() {
// Thank you ARC + Weak References
func testEmptyAfterAddWeakReference() {

Comment thread
coachroebuck marked this conversation as resolved.
Outdated
let multicastDelegate = MulticastDelegate<TestDelegate>()
multicastDelegate += DelegateTestClass()

Comment thread
coachroebuck marked this conversation as resolved.
Outdated
XCTAssertTrue(multicastDelegate.isEmpty)
}

Comment thread
coachroebuck marked this conversation as resolved.
Outdated
func testEmptyAfterDoubleAddWeakReferences() {

let multicastDelegate = MulticastDelegate<TestDelegate>()
multicastDelegate += DelegateTestClass()
multicastDelegate += DelegateTestClass()

XCTAssertFalse(multicastDelegate.isEmpty)
XCTAssertTrue(multicastDelegate.isEmpty)
}

func testEmptyAfterAddAndDelete() {
Expand Down