1
1
mirror of https://github.com/exyte/Macaw.git synced 2024-09-11 13:15:35 +03:00
Macaw/MacawTests/MacawSVGTests.swift
Yuriy Kashnikov d27e20e1f5 Fix review comments
- Update SVG tests: added basic test for ellipse.svg
- Handle optional params via Optional
2017-09-13 16:02:04 +03:00

28 lines
1017 B
Swift

import XCTest
@testable import Macaw
class MacawSVGTests: XCTestCase {
override func setUp() {
// Put setup code here. This method is called before the invocation of each test method in the class.
super.setUp()
}
override func tearDown() {
// Put teardown code here. This method is called after the invocation of each test method in the class.
super.tearDown()
}
func testSVGEllipse() {
let bundle = Bundle(for: type(of: TestUtils()))
let ellipseReferenceContent = "<svg xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" version=\"1.1\" ><g><ellipse cy=\"80\" ry=\"50\" rx=\"100\" cx=\"200\" fill=\"yellow\" stroke=\"purple\" stroke-width=\"2\"/></g></svg>"
do {
let node = try SVGParser.parse(bundle:bundle, path: "ellipse")
XCTAssert(SVGSerializer.serialize(node: node) == ellipseReferenceContent)
} catch {
print(error)
}
}
}