Sha256: 1768afbd909ee156d4f45e60781de591928349a88b37094e2e35652107828d42

Contents?: true

Size: 1.02 KB

Versions: 325

Compression:

Stored size: 1.02 KB

Contents

import XCTest
@testable import PerfectNumbers

class PerfectNumbersTests: XCTestCase {
    func testPerfect() {
        let numberClassifier = NumberClassifier(number: 6)
        XCTAssertEqual([.perfect], [numberClassifier.classification])
    }

    func testPerfectAgain() {
        let numberClassifier = NumberClassifier(number: 28)
        XCTAssertEqual([.perfect], [numberClassifier.classification])
    }

    func testDeficient() {
        let numberClassifier = NumberClassifier(number: 13)
        XCTAssertEqual([.deficient], [numberClassifier.classification])

    }

    func testAbundant() {
        let numberClassifier = NumberClassifier(number: 12)
        XCTAssertEqual([.abundant], [numberClassifier.classification])
    }

    static var allTests: [(String, (PerfectNumbersTests) -> () throws -> Void)] {
        return [
            ("testPerfect", testPerfect),
            ("testPerfectAgain", testPerfectAgain),
            ("testDeficient", testDeficient),
            ("testAbundant", testAbundant),
        ]
    }
}

Version data entries

325 entries across 325 versions & 1 rubygems

Version Path
trackler-2.2.1.180 tracks/swift/exercises/perfect-numbers/Tests/PerfectNumbersTests/PerfectNumbersTests.swift
trackler-2.2.1.179 tracks/swift/exercises/perfect-numbers/Tests/PerfectNumbersTests/PerfectNumbersTests.swift
trackler-2.2.1.178 tracks/swift/exercises/perfect-numbers/Tests/PerfectNumbersTests/PerfectNumbersTests.swift
trackler-2.2.1.177 tracks/swift/exercises/perfect-numbers/Tests/PerfectNumbersTests/PerfectNumbersTests.swift
trackler-2.2.1.176 tracks/swift/exercises/perfect-numbers/Tests/PerfectNumbersTests/PerfectNumbersTests.swift
trackler-2.2.1.175 tracks/swift/exercises/perfect-numbers/Tests/PerfectNumbersTests/PerfectNumbersTests.swift
trackler-2.2.1.174 tracks/swift/exercises/perfect-numbers/Tests/PerfectNumbersTests/PerfectNumbersTests.swift
trackler-2.2.1.173 tracks/swift/exercises/perfect-numbers/Tests/PerfectNumbersTests/PerfectNumbersTests.swift
trackler-2.2.1.172 tracks/swift/exercises/perfect-numbers/Tests/PerfectNumbersTests/PerfectNumbersTests.swift
trackler-2.2.1.171 tracks/swift/exercises/perfect-numbers/Tests/PerfectNumbersTests/PerfectNumbersTests.swift
trackler-2.2.1.170 tracks/swift/exercises/perfect-numbers/Tests/PerfectNumbersTests/PerfectNumbersTests.swift
trackler-2.2.1.169 tracks/swift/exercises/perfect-numbers/Tests/PerfectNumbersTests/PerfectNumbersTests.swift
trackler-2.2.1.167 tracks/swift/exercises/perfect-numbers/Tests/PerfectNumbersTests/PerfectNumbersTests.swift
trackler-2.2.1.166 tracks/swift/exercises/perfect-numbers/Tests/PerfectNumbersTests/PerfectNumbersTests.swift
trackler-2.2.1.165 tracks/swift/exercises/perfect-numbers/Tests/PerfectNumbersTests/PerfectNumbersTests.swift
trackler-2.2.1.164 tracks/swift/exercises/perfect-numbers/Tests/PerfectNumbersTests/PerfectNumbersTests.swift
trackler-2.2.1.163 tracks/swift/exercises/perfect-numbers/Tests/PerfectNumbersTests/PerfectNumbersTests.swift
trackler-2.2.1.162 tracks/swift/exercises/perfect-numbers/Tests/PerfectNumbersTests/PerfectNumbersTests.swift
trackler-2.2.1.161 tracks/swift/exercises/perfect-numbers/Tests/PerfectNumbersTests/PerfectNumbersTests.swift
trackler-2.2.1.160 tracks/swift/exercises/perfect-numbers/Tests/PerfectNumbersTests/PerfectNumbersTests.swift