This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // | |
| // UIColor+Carsales.swift | |
| // CSAppKit | |
| // | |
| // Created by Ben Thomas on 22/11/19. | |
| // Copyright © 2019 Carsales.com.au. All rights reserved. | |
| // | |
| import Foundation |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| func testResultOfNameAndAddressFunc() { | |
| XCTAssertEqual(ViewModel().nameAndAddress, "") | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import UIKit | |
| import PlaygroundSupport | |
| import XCTest | |
| struct Person { | |
| let firstName: String | |
| let lastName: String | |
| let address: String | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| struct ViewModel { | |
| var person: Person | |
| var nameAndAddress: String { | |
| return "\(person.firstName)\(person.lastName), \(person.address)" | |
| } | |
| init() { | |
| person = Person(firstName: "John", | |
| lastName: "Appleseed", | |
| address: "1 Infinite Loop, Cupertino, CA") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| struct Person { | |
| let firstName: String | |
| let lastName: String | |
| let address: String | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| func testResultOfNameAndAddressFunc() { | |
| XCTAssertEqual(ViewModel().nameAndAddress, | |
| "John Appleseed, 1 Infinite Loop, Cupertino, CA") | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| XCTAssertEqual failed: ("John Appleseed, 1 Infinite Loop, Cupertino, CA") is not equal to ("") — |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| struct Person { | |
| let name: String | |
| let address: String | |
| } | |
| struct ViewModel { | |
| var person: Person | |
| var nameAndAddress: String { | |
| return "\(person.name), \(person.address)" | |
| } |