diff --git a/FoundationExtras/Tests/FoundationExtrasTests/ArrayExtensionsTests.swift b/FoundationExtras/Tests/FoundationExtrasTests/ArrayExtensionsTests.swift new file mode 100644 index 000000000..22d7e6bad --- /dev/null +++ b/FoundationExtras/Tests/FoundationExtrasTests/ArrayExtensionsTests.swift @@ -0,0 +1,31 @@ +// +// ArrayExtensionsTests.swift +// +// +// Created by Brent Simmons on 5/18/24. +// + +import XCTest +import FoundationExtras + +final class ArrayExtensionsTests: XCTestCase { + + // MARK: - Test chunked(into:) + + func testChunkedInto_Empty() { + + let testArray = [Int]() + let resultArray = testArray.chunked(into: 50) + XCTAssert(resultArray.isEmpty) + } + + func testChunkedInto_LessThanOneChunk() { + + let testArray = [1, 2, 3, 4, 5, 6]; + let resultArray = testArray.chunked(into: 7) + XCTAssert(resultArray.count == 1) + + let singleElement = resultArray[0] + XCTAssertEqual(singleElement, testArray) + } +} diff --git a/FoundationExtras/Tests/FoundationExtrasTests/FoundationExtrasTests.swift b/FoundationExtras/Tests/FoundationExtrasTests/FoundationExtrasTests.swift deleted file mode 100644 index c3cb158ab..000000000 --- a/FoundationExtras/Tests/FoundationExtrasTests/FoundationExtrasTests.swift +++ /dev/null @@ -1,12 +0,0 @@ -import XCTest -@testable import FoundationExtras - -final class FoundationExtrasTests: XCTestCase { - func testExample() throws { - // XCTest Documentation - // https://developer.apple.com/documentation/xctest - - // Defining Test Cases and Test Methods - // https://developer.apple.com/documentation/xctest/defining_test_cases_and_test_methods - } -}