Skip to content

Commit

Permalink
Update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
jaroshevskii committed Jan 14, 2024
1 parent c128e07 commit 011eddc
Showing 1 changed file with 43 additions and 10 deletions.
53 changes: 43 additions & 10 deletions Tests/IceCreamSandwichTests/IceCreamSandwichTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,53 @@ import XCTest
@testable import IceCreamSandwich

final class IcecreamSandwichTests: XCTestCase {
func testValidIcecreamSandwich() {
XCTAssertTrue("CDC".isIceCreamSandwich)
XCTAssertTrue("AABBBAA".isIceCreamSandwich)
XCTAssertTrue("3&&3".isIceCreamSandwich)
func testStringIceCreamSandwich() {
XCTAssertTrue("AABBA".isIceCreamSandwich)
}

func testArrayIceCreamSandwich() {
XCTAssertTrue([1, 2, 2, 1].isIceCreamSandwich)
}

func testBoolArrayIceCreamSandwich() {
XCTAssertTrue([true, true, false, true, true].isIceCreamSandwich)
}

func testStringNotIceCreamSandwich() {
XCTAssertFalse("ABBA".isIceCreamSandwich)
}

func testArrayNotIceCreamSandwich() {
XCTAssertFalse([1, 2, 3, 1].isIceCreamSandwich)
}

func testBoolArrayNotIceCreamSandwich() {
XCTAssertFalse([false, true, false].isIceCreamSandwich)
}

func testTooShortCollection() {
XCTAssertFalse("AA".isIceCreamSandwich)
}

func testIntegerIceCreamSandwich() {
XCTAssertTrue(11211.isIceCreamSandwich)
}

func testAnotherIntegerIceCreamSandwich() {
XCTAssertTrue(1221.isIceCreamSandwich)
}

func testInvalidIcecreamSandwich() {
XCTAssertFalse("BBBBB".isIceCreamSandwich)
XCTAssertFalse("AAACCCAA".isIceCreamSandwich)
XCTAssertFalse("AACDCAA".isIceCreamSandwich)
XCTAssertFalse("A".isIceCreamSandwich)
func testIntegerNotIceCreamSandwich() {
XCTAssertFalse(121.isIceCreamSandwich)
}

func testAnotherIntegerNotIceCreamSandwich() {
XCTAssertFalse(1231.isIceCreamSandwich)
}

func testEmptyString() {
func testEmptyCollection() {
XCTAssertFalse("".isIceCreamSandwich)
XCTAssertFalse([Int]().isIceCreamSandwich)
XCTAssertFalse([Bool]().isIceCreamSandwich)
}
}

0 comments on commit 011eddc

Please sign in to comment.