diff --git a/Package.resolved b/Package.resolved
index 1374a2a..2bae2fa 100644
--- a/Package.resolved
+++ b/Package.resolved
@@ -37,24 +37,6 @@
"version": "1.3.1"
}
},
- {
- "package": "Fluent",
- "repositoryURL": "https://github.com/vapor/fluent.git",
- "state": {
- "branch": null,
- "revision": "00b81a9362549facb8e2ac93b17d2a78599fce3b",
- "version": "3.1.2"
- }
- },
- {
- "package": "FluentSQLite",
- "repositoryURL": "https://github.com/vapor/fluent-sqlite.git",
- "state": {
- "branch": null,
- "revision": "c32f5bda84bf4ea691d19afe183d40044f579e11",
- "version": "3.0.0"
- }
- },
{
"package": "HTTP",
"repositoryURL": "https://github.com/vapor/http.git",
@@ -91,24 +73,6 @@
"version": "1.0.0"
}
},
- {
- "package": "SQL",
- "repositoryURL": "https://github.com/vapor/sql.git",
- "state": {
- "branch": null,
- "revision": "839cf96eba296d26151ff1d7a746e9fe35053584",
- "version": "2.2.0"
- }
- },
- {
- "package": "SQLite",
- "repositoryURL": "https://github.com/vapor/sqlite.git",
- "state": {
- "branch": null,
- "revision": "ad2e9bc9f0ed00ef2c6a05f89c1cec605467c90f",
- "version": "3.1.0"
- }
- },
{
"package": "swift-nio",
"repositoryURL": "https://github.com/apple/swift-nio.git",
diff --git a/Package.swift b/Package.swift
index 9db393f..ca85cf9 100644
--- a/Package.swift
+++ b/Package.swift
@@ -17,6 +17,6 @@ let package = Package(
.target(name: "Twilio", dependencies: ["Vapor"]),
.target(name: "App", dependencies: ["Vapor", "Twilio"]),
.target(name: "Run", dependencies: ["App"]),
- .testTarget(name: "AppTests", dependencies: ["App"])
+ .testTarget(name: "AppTests", dependencies: ["Twilio"])
]
)
diff --git a/Tests/AppTests/AppTests.swift b/Tests/AppTests/AppTests.swift
deleted file mode 100644
index 2c101e1..0000000
--- a/Tests/AppTests/AppTests.swift
+++ /dev/null
@@ -1,13 +0,0 @@
-import App
-import XCTest
-
-final class AppTests: XCTestCase {
- func testNothing() throws {
- // add your tests here
- XCTAssert(true)
- }
-
- static let allTests = [
- ("testNothing", testNothing)
- ]
-}
diff --git a/Tests/AppTests/TWIMLTests.swift b/Tests/AppTests/TWIMLTests.swift
new file mode 100644
index 0000000..5895b7e
--- /dev/null
+++ b/Tests/AppTests/TWIMLTests.swift
@@ -0,0 +1,72 @@
+import Twilio
+import XCTest
+
+final class TWIMLTests: XCTestCase {
+ func testSMSResponse() throws {
+ let smsResponse = SMSResponse()
+
+ let expectedTwiml = """
+
+
+
+
+ """
+
+ XCTAssertEqual(smsResponse.generateTwiml(), expectedTwiml)
+ }
+
+ func testMessage() throws {
+ let message = Message(body: "Hello!")
+ let expectedTwiml = """
+
+
+ Hello!
+
+
+ """
+
+ XCTAssertEqual(message.generateTwiml(), expectedTwiml)
+ }
+
+ func testSMSResponseWithSingleMessage() throws {
+ let message = Message(body: "Hello!")
+ let smsResponseWithMessage = SMSResponse(message)
+
+ let expectedTwiml = """
+
+
+
+
+ Hello!
+
+
+
+ """
+
+ XCTAssertEqual(smsResponseWithMessage.generateTwiml(), expectedTwiml)
+ }
+
+ func testSMSResponseWithMultipleMessages() throws {
+ let message = Message(body: "Hello")
+ let otherMessage = Message(body: "world!")
+ let smsResponseWithMessage = SMSResponse(message, otherMessage)
+
+ let expectedTwiml = """
+
+
+
+
+ Hello
+
+
+
+
+ world!
+
+
+
+ """
+
+ XCTAssertEqual(smsResponseWithMessage.generateTwiml(), expectedTwiml)
+ }
+}