Skip to content

Commit

Permalink
Add circle view tests
Browse files Browse the repository at this point in the history
  • Loading branch information
amerhukic committed Jan 28, 2019

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
1 parent 9291716 commit 19019a8
Showing 3 changed files with 50 additions and 33 deletions.
13 changes: 8 additions & 5 deletions Example/AHDownloadButton.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
@@ -7,11 +7,11 @@
objects = {

/* Begin PBXBuildFile section */
19C0725A21FF32E00081B420 /* CircleViewTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 19C0725921FF32E00081B420 /* CircleViewTests.swift */; };
607FACD61AFB9204008FA782 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 607FACD51AFB9204008FA782 /* AppDelegate.swift */; };
607FACD81AFB9204008FA782 /* DownloadViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 607FACD71AFB9204008FA782 /* DownloadViewController.swift */; };
607FACDD1AFB9204008FA782 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 607FACDC1AFB9204008FA782 /* Images.xcassets */; };
607FACE01AFB9204008FA782 /* LaunchScreen.xib in Resources */ = {isa = PBXBuildFile; fileRef = 607FACDE1AFB9204008FA782 /* LaunchScreen.xib */; };
607FACEC1AFB9204008FA782 /* Tests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 607FACEB1AFB9204008FA782 /* Tests.swift */; };
D9E1BAE1A47B8C79B3EB6A24 /* Pods_AHDownloadButton_Example.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = B8499D8AA25BEB358EB96FFD /* Pods_AHDownloadButton_Example.framework */; };
FA1A504BC61ED8CE19ABD332 /* Pods_AHDownloadButton_Tests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3B1E2116AD5843C693919D1D /* Pods_AHDownloadButton_Tests.framework */; };
/* End PBXBuildFile section */
@@ -28,6 +28,7 @@

/* Begin PBXFileReference section */
023A2A6DD90614A817E77D09 /* Pods-AHDownloadButton_Example.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-AHDownloadButton_Example.release.xcconfig"; path = "Pods/Target Support Files/Pods-AHDownloadButton_Example/Pods-AHDownloadButton_Example.release.xcconfig"; sourceTree = "<group>"; };
19C0725921FF32E00081B420 /* CircleViewTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CircleViewTests.swift; sourceTree = "<group>"; };
3B1E2116AD5843C693919D1D /* Pods_AHDownloadButton_Tests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_AHDownloadButton_Tests.framework; sourceTree = BUILT_PRODUCTS_DIR; };
607FACD01AFB9204008FA782 /* AHDownloadButton_Example.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = AHDownloadButton_Example.app; sourceTree = BUILT_PRODUCTS_DIR; };
607FACD41AFB9204008FA782 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
@@ -37,7 +38,6 @@
607FACDF1AFB9204008FA782 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/LaunchScreen.xib; sourceTree = "<group>"; };
607FACE51AFB9204008FA782 /* AHDownloadButton_Tests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = AHDownloadButton_Tests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
607FACEA1AFB9204008FA782 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
607FACEB1AFB9204008FA782 /* Tests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Tests.swift; sourceTree = "<group>"; };
67CF4BFAD38CEE7D0694966C /* README.md */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = net.daringfireball.markdown; name = README.md; path = ../README.md; sourceTree = "<group>"; };
7929F5F7A75146180BC214F9 /* Pods-AHDownloadButton_Example.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-AHDownloadButton_Example.debug.xcconfig"; path = "Pods/Target Support Files/Pods-AHDownloadButton_Example/Pods-AHDownloadButton_Example.debug.xcconfig"; sourceTree = "<group>"; };
93119861EEF364B63633C26D /* LICENSE */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; name = LICENSE; path = ../LICENSE; sourceTree = "<group>"; };
@@ -123,8 +123,8 @@
607FACE81AFB9204008FA782 /* Tests */ = {
isa = PBXGroup;
children = (
607FACEB1AFB9204008FA782 /* Tests.swift */,
607FACE91AFB9204008FA782 /* Supporting Files */,
19C0725921FF32E00081B420 /* CircleViewTests.swift */,
);
path = Tests;
sourceTree = "<group>";
@@ -216,7 +216,7 @@
};
607FACE41AFB9204008FA782 = {
CreatedOnToolsVersion = 6.3.1;
LastSwiftMigration = 0900;
LastSwiftMigration = 1010;
TestTargetID = 607FACCF1AFB9204008FA782;
};
};
@@ -375,7 +375,7 @@
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
607FACEC1AFB9204008FA782 /* Tests.swift in Sources */,
19C0725A21FF32E00081B420 /* CircleViewTests.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -542,6 +542,7 @@
isa = XCBuildConfiguration;
baseConfigurationReference = F872A62AE582B051C2615CDA /* Pods-AHDownloadButton_Tests.debug.xcconfig */;
buildSettings = {
CLANG_ENABLE_MODULES = YES;
DEVELOPMENT_TEAM = "";
GCC_PREPROCESSOR_DEFINITIONS = (
"DEBUG=1",
@@ -551,6 +552,7 @@
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
SWIFT_VERSION = 4.2;
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/AHDownloadButton_Example.app/AHDownloadButton_Example";
@@ -561,6 +563,7 @@
isa = XCBuildConfiguration;
baseConfigurationReference = D30B8FFC1198B90747524EB6 /* Pods-AHDownloadButton_Tests.release.xcconfig */;
buildSettings = {
CLANG_ENABLE_MODULES = YES;
DEVELOPMENT_TEAM = "";
INFOPLIST_FILE = Tests/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
42 changes: 42 additions & 0 deletions Example/Tests/CircleViewTests.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
//
// CircleViewTests.swift
// AHDownloadButton_Tests
//
// Created by Amer Hukic on 28/01/2019.
// Copyright © 2019 CocoaPods. All rights reserved.
//

import XCTest
@testable import AHDownloadButton

class CircleViewTests: XCTestCase {

var circleView: CircleView!

override func setUp() {
super.setUp()
circleView = CircleView()
}

override func tearDown() {
super.tearDown()
circleView = nil
}

func testSettingLineWidthShouldSetLayerLineWidth() {
circleView.lineWidth = 2
XCTAssert(circleView.circleLayer.lineWidth == 2)
}

func testSettingCircleColorShouldSetLayerStrokeColor() {
circleView.circleColor = .white
XCTAssert(circleView.circleLayer.strokeColor == UIColor.white.cgColor)
}

func testLayoutSubviewsShouldCreateCircleLayerPath() {
circleView.layoutSubviews()
XCTAssertNotNil(circleView.circleLayer.path)
}


}
28 changes: 0 additions & 28 deletions Example/Tests/Tests.swift

This file was deleted.

0 comments on commit 19019a8

Please sign in to comment.