Skip to content

Commit

Permalink
Test UIRectEdge+Utilities
Browse files Browse the repository at this point in the history
Change-Id: I6762e2d17b0572e42ecd60538752c75d8f415f90
  • Loading branch information
gaetanzanella committed Nov 18, 2021
1 parent 1b8196f commit 1913cf4
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 0 deletions.
4 changes: 4 additions & 0 deletions ADUtils.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@
92DA1F5F2257556800060A32 /* NSLayoutConstraintUtilsTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 92DA1F5E2257556800060A32 /* NSLayoutConstraintUtilsTests.swift */; };
92FAEA942271DF0D0090A2C7 /* FailableDecodableTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 92FAEA932271DF0D0090A2C7 /* FailableDecodableTests.swift */; };
B0E1495F269444E600712620 /* SecureArchiverTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = B0E1495E269444E600712620 /* SecureArchiverTests.swift */; };
E75B4EE8274663D2006A327D /* UIRectEdgeTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = E75B4EE7274663D2006A327D /* UIRectEdgeTest.swift */; };
E7D5F497242DED3C0048C0DC /* OptionalGetTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = E7D5F496242DED3C0048C0DC /* OptionalGetTests.swift */; };
E7D5F499242DEF120048C0DC /* UINavigationItemBackItemTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = E7D5F498242DEF120048C0DC /* UINavigationItemBackItemTests.swift */; };
E7D5F49B242DF01F0048C0DC /* UIScreenPixelDimensionTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = E7D5F49A242DF01F0048C0DC /* UIScreenPixelDimensionTests.swift */; };
Expand Down Expand Up @@ -138,6 +139,7 @@
9C9220CDCE8C495437E023DB /* Pods-ADUtilsTests.stubs.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-ADUtilsTests.stubs.xcconfig"; path = "Pods/Target Support Files/Pods-ADUtilsTests/Pods-ADUtilsTests.stubs.xcconfig"; sourceTree = "<group>"; };
B0E1495E269444E600712620 /* SecureArchiverTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SecureArchiverTests.swift; sourceTree = "<group>"; };
D06C6332AC4E8FBA4930E980 /* Pods_ADUtilsTests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_ADUtilsTests.framework; sourceTree = BUILT_PRODUCTS_DIR; };
E75B4EE7274663D2006A327D /* UIRectEdgeTest.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UIRectEdgeTest.swift; sourceTree = "<group>"; };
E7D5F496242DED3C0048C0DC /* OptionalGetTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = OptionalGetTests.swift; sourceTree = "<group>"; };
E7D5F498242DEF120048C0DC /* UINavigationItemBackItemTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UINavigationItemBackItemTests.swift; sourceTree = "<group>"; };
E7D5F49A242DF01F0048C0DC /* UIScreenPixelDimensionTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UIScreenPixelDimensionTests.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -214,6 +216,7 @@
49BA42C62167B8BE00578C48 /* LayoutGuideConstraintsTests.swift */,
ECB627051DE33F2200951346 /* AttributedStringTest.swift */,
49EE98A11DE5F2DC00DE1CB8 /* UIEdgeInsetsTest.swift */,
E75B4EE7274663D2006A327D /* UIRectEdgeTest.swift */,
49EE98A31DE6CAE100DE1CB8 /* RegisterableViewTest.swift */,
49D85E011E1E6F5300233A3F /* PropertyListArchiverTest.swift */,
49F0F21021625E7000FC8AA4 /* StringLocalizationTests.swift */,
Expand Down Expand Up @@ -683,6 +686,7 @@
496EB3C1246008E80011B4AD /* UITableViewHeaderFooterViewLayoutTests.swift in Sources */,
494C99852601FA5A00A1E098 /* StackViewBuilderTests.swift in Sources */,
49CC380120C048F800CFEDDB /* ArrayFilterTests.swift in Sources */,
E75B4EE8274663D2006A327D /* UIRectEdgeTest.swift in Sources */,
4988CBBE215931B4003A3C08 /* OptionalStringIsBlankTests.swift in Sources */,
87C139C32695EFBA00CEE5A1 /* PostInstallationKeychainCleanerTests.swift in Sources */,
F2F326C12448431300BB5700 /* NSDirectionalEdgeInsetsTests.swift in Sources */,
Expand Down
45 changes: 45 additions & 0 deletions ADUtilsTests/UIRectEdgeTest.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
//
// UIRectEdgeTest.swift
// ADUtils
//
// Created by Gaétan Zanella on 18/11/21.
//
//

import Foundation
import Quick
import Nimble
import ADUtils

class UIRectEdgeTest: QuickSpec {

override func spec() {

describe("horizontal edges") {
let horizontalEdge: UIRectEdge = .horizontal
it("should contain horizontal values") {
expect(horizontalEdge).to(contain(.left))
expect(horizontalEdge).to(contain(.right))
}

it("should not contain vertical values") {
expect(horizontalEdge).toNot(contain(.bottom))
expect(horizontalEdge).toNot(contain(.top))
}
}

describe("vertical edges") {
let verticalEdge: UIRectEdge = .horizontal
it("should contain vertical values") {
expect(verticalEdge).to(contain(.bottom))
expect(verticalEdge).to(contain(.top))
}

it("should not contain horizontal values") {
expect(verticalEdge).toNot(contain(.left))
expect(verticalEdge).toNot(contain(.right))
}
}
}

}

0 comments on commit 1913cf4

Please sign in to comment.