Skip to content

Commit

Permalink
add descriptions to test cases
Browse files Browse the repository at this point in the history
  • Loading branch information
5d committed Apr 9, 2024
1 parent ac17377 commit 6569f7b
Showing 1 changed file with 16 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,11 @@ import XCTest

class ArrayWithErrorElementExtensionTests: XCTestCase {



/**
Given: errors with generic protocol type
When: cast to the correct underlying concrete type
Then: successfully casted to underlying concrete type
*/
func testCast_toCorrectErrorType_returnCastedErrorType() {
let errors: [Error] = [
Error1(), Error1(), Error1()
Expand All @@ -24,6 +27,11 @@ class ArrayWithErrorElementExtensionTests: XCTestCase {
XCTAssertEqual(errors.count, error1s!.count)
}

/**
Given: errors with generic protocol type
When: cast to the wong underlying concrete type
Then: return nil
*/
func testCast_toWrongErrorType_returnNil() {
let errors: [Error] = [
Error1(), Error1(), Error1()
Expand All @@ -33,6 +41,12 @@ class ArrayWithErrorElementExtensionTests: XCTestCase {
XCTAssertNil(error2s)
}

/**
Given: errors with generic protocol type
When: some of the elements failed to cast to the underlying concrete type
Then: return nil
*/

func testCast_partiallyToWrongErrorType_returnNil() {
let errors: [Error] = [
Error2(), Error2(), Error1()
Expand Down

0 comments on commit 6569f7b

Please sign in to comment.