From d35cbc70c87bdbe9a202e7c6eb528e88a8004fe7 Mon Sep 17 00:00:00 2001
From: kondeichmann <k.deichmann@mac.com>
Date: Mon, 8 Jan 2018 13:11:11 +0100
Subject: [PATCH] add Tests for Invitation

---
 enzevalos_iphoneTests/InvitationTests.swift | 38 +++++++++++++++++++++
 1 file changed, 38 insertions(+)
 create mode 100644 enzevalos_iphoneTests/InvitationTests.swift

diff --git a/enzevalos_iphoneTests/InvitationTests.swift b/enzevalos_iphoneTests/InvitationTests.swift
new file mode 100644
index 00000000..371b6a16
--- /dev/null
+++ b/enzevalos_iphoneTests/InvitationTests.swift
@@ -0,0 +1,38 @@
+//
+//  InvitationTests.swift
+//  enzevalos_iphoneTests
+//
+//  Created by Konstantin Deichmann on 08.01.18.
+//  Copyright © 2018 fu-berlin. All rights reserved.
+//
+
+import XCTest
+
+@testable import enzevalos_iphone
+
+class InvitationTests: XCTestCase {
+
+	func testWordsInString() {
+
+		let string = "Diese App hat viele Vorteile"
+		let firstStringRange = NSRange(location: 0, length: 5)
+		let secondStringRange = NSRange(location: 7, length: 9)
+
+		let firstResult = string.words(inRange: firstStringRange)
+		let secondResult = string.words(inRange: secondStringRange)
+
+		print(firstResult)
+		XCTAssertEqual(firstResult.count, 1)
+		XCTAssertEqual(firstResult.first?.word, "Diese")
+		XCTAssertEqual(firstResult.first?.index, 0)
+
+		print(secondResult)
+		XCTAssertEqual(secondResult.count, 3)
+		XCTAssertEqual(secondResult[0].word, "App")
+		XCTAssertEqual(secondResult[1].word, "hat")
+		XCTAssertEqual(secondResult[2].word, "viele")
+		XCTAssertEqual(secondResult[0].index, 6)
+		XCTAssertEqual(secondResult[1].index, 10)
+		XCTAssertEqual(secondResult[2].index, 14)
+	}
+}
-- 
GitLab