Repository navigation
Expand file tree
/
Copy pathAnagramTest.swift
More file actions
48 lines (40 loc) · 1.68 KB
/
Copy pathAnagramTest.swift
File metadata and controls
48 lines (40 loc) · 1.68 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
//
// AnagramTest.swift
// algorithm_swiftTests
//
// Created by Haibo Yan on 3/26/18.
// Copyright © 2018 Haibo Yan. All rights reserved.
//
import XCTest
@testable import algorithm_swift
class AnagramTest: XCTestCase {
let anagram = Anagram()
override func setUp() {
super.setUp()
// Put setup code here. This method is called before the invocation of each test method in the class.
}
override func tearDown() {
// Put teardown code here. This method is called after the invocation of each test method in the class.
super.tearDown()
}
func testSimple1() {
// This is an example of a functional test case.
// Use XCTAssert and related functions to verify your tests produce the correct results.
XCTAssertTrue(anagram.isAnagram("anagram", "nagaram"), "anagram and nagaram are anagram")
}
func testSimple2() {
// This is an example of a functional test case.
// Use XCTAssert and related functions to verify your tests produce the correct results.
XCTAssertFalse(anagram.isAnagram("rat", "cat"), "rat and cat are not anagram")
}
func testSimple3() {
// This is an example of a functional test case.
// Use XCTAssert and related functions to verify your tests produce the correct results.
XCTAssertFalse(anagram.isAnagram("eat", "eating"), "eat and eating are not anagram")
}
func testSimple4() {
// This is an example of a functional test case.
// Use XCTAssert and related functions to verify your tests produce the correct results.
XCTAssertTrue(anagram.isAnagram("cat", "cat"), "cat and cat are anagram")
}
}