Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- enum Ugar {
- case foo(Foo)
- case none
- }
- class Foo {
- let title: String
- init(_ title: String) {
- self.title = title
- print("init \(title)")
- }
- deinit {
- print("deinit \(title)")
- }
- }
- class UgarTestCase : XCTestCase {
- var bar : Ugar = .none
- var foo : Foo!
- var foo1: Foo?
- var omg: Foo = Foo("property")
- override func setUp() {
- super.setUp()
- bar = .foo(Foo("enum"))
- foo = Foo("implicitly unwrapped optional")
- foo1 = Foo("optional")
- omg = Foo("non optional property")
- }
- func testUgar() {
- }
- func testOmg() {
- }
- }
- OUTPUT:
- init property
- init property
- Test Suite 'Selected tests' started at 2018-03-21 18:22:31.015
- Test Suite 'StickersTests.xctest' started at 2018-03-21 18:22:31.016
- Test Suite 'UgarTestCase' started at 2018-03-21 18:22:31.016
- Test Case '-[StickersTests.UgarTestCase testOmg]' started.
- init enum
- init implicitly unwrapped optional
- init optional
- init non optional property
- deinit property
- Test Case '-[StickersTests.UgarTestCase testOmg]' passed (0.001 seconds).
- Test Case '-[StickersTests.UgarTestCase testUgar]' started.
- init enum
- init implicitly unwrapped optional
- init optional
- init non optional property
- deinit property
- Test Case '-[StickersTests.UgarTestCase testUgar]' passed (0.000 seconds).
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement