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.119 tracks/swift/exercises/perfect-numbers/Tests/PerfectNumbersTests/PerfectNumbersTests.swift
trackler-2.2.1.118 tracks/swift/exercises/perfect-numbers/Tests/PerfectNumbersTests/PerfectNumbersTests.swift
trackler-2.2.1.117 tracks/swift/exercises/perfect-numbers/Tests/PerfectNumbersTests/PerfectNumbersTests.swift
trackler-2.2.1.116 tracks/swift/exercises/perfect-numbers/Tests/PerfectNumbersTests/PerfectNumbersTests.swift
trackler-2.2.1.115 tracks/swift/exercises/perfect-numbers/Tests/PerfectNumbersTests/PerfectNumbersTests.swift
trackler-2.2.1.114 tracks/swift/exercises/perfect-numbers/Tests/PerfectNumbersTests/PerfectNumbersTests.swift
trackler-2.2.1.113 tracks/swift/exercises/perfect-numbers/Tests/PerfectNumbersTests/PerfectNumbersTests.swift
trackler-2.2.1.111 tracks/swift/exercises/perfect-numbers/Tests/PerfectNumbersTests/PerfectNumbersTests.swift
trackler-2.2.1.110 tracks/swift/exercises/perfect-numbers/Tests/PerfectNumbersTests/PerfectNumbersTests.swift
trackler-2.2.1.109 tracks/swift/exercises/perfect-numbers/Tests/PerfectNumbersTests/PerfectNumbersTests.swift
trackler-2.2.1.108 tracks/swift/exercises/perfect-numbers/Tests/PerfectNumbersTests/PerfectNumbersTests.swift
trackler-2.2.1.107 tracks/swift/exercises/perfect-numbers/Tests/PerfectNumbersTests/PerfectNumbersTests.swift
trackler-2.2.1.106 tracks/swift/exercises/perfect-numbers/Tests/PerfectNumbersTests/PerfectNumbersTests.swift
trackler-2.2.1.105 tracks/swift/exercises/perfect-numbers/Tests/PerfectNumbersTests/PerfectNumbersTests.swift
trackler-2.2.1.104 tracks/swift/exercises/perfect-numbers/Tests/PerfectNumbersTests/PerfectNumbersTests.swift
trackler-2.2.1.103 tracks/swift/exercises/perfect-numbers/Tests/PerfectNumbersTests/PerfectNumbersTests.swift
trackler-2.2.1.102 tracks/swift/exercises/perfect-numbers/Tests/PerfectNumbersTests/PerfectNumbersTests.swift
trackler-2.2.1.101 tracks/swift/exercises/perfect-numbers/Tests/PerfectNumbersTests/PerfectNumbersTests.swift
trackler-2.2.1.100 tracks/swift/exercises/perfect-numbers/Tests/PerfectNumbersTests/PerfectNumbersTests.swift
trackler-2.2.1.99 tracks/swift/exercises/perfect-numbers/Tests/PerfectNumbersTests/PerfectNumbersTests.swift