Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add landscape orientation tests #236

Merged
merged 17 commits into from
Dec 6, 2023
Merged
Show file tree
Hide file tree
Changes from 10 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions Tests/LayoutTests/ConstraintsBuilderTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -21,34 +21,53 @@ final class ConstraintsBuilderTests: XCTestCase {

// THEN

// Build Expression With None and Constraint

expect(ConstraintsBuilder.buildExpression(Optional<NSLayoutConstraint>.none)).to(beEmpty())
expect(ConstraintsBuilder.buildExpression(constraint)) == [constraint]

// Build Expression With None and Constraint Array

expect(ConstraintsBuilder.buildExpression(Optional<[NSLayoutConstraint]>.none)).to(beEmpty())
expect(ConstraintsBuilder.buildExpression([constraint])) == [constraint]

// Build Block With No Input and Constraint Array

expect(ConstraintsBuilder.buildBlock()).to(beEmpty())
expect(ConstraintsBuilder.buildBlock([constraint])) == [constraint]

// Build Block With Constraint Arrays

expect(ConstraintsBuilder.buildBlock([constraint], [constraint], [constraint])) == [
constraint,
constraint,
constraint
]

// Build Optional With Nil and Constraint Array

expect(ConstraintsBuilder.buildOptional(nil)).to(beEmpty())
expect(ConstraintsBuilder.buildOptional([constraint])) == [constraint]

// Build Either With First and Second Constraint Array

expect(ConstraintsBuilder.buildEither(first: [constraint])) == [constraint]
expect(ConstraintsBuilder.buildEither(second: [constraint])) == [constraint]

// Build Array With Array of Constraint Arrays

expect(ConstraintsBuilder.buildArray([[constraint], [constraint], [constraint]])) == [
constraint,
constraint,
constraint
]

// Build Limited Availability With Constraint Array

expect(ConstraintsBuilder.buildLimitedAvailability([constraint])) == [constraint]

// Build Final Result With Constraint Array

expect(ConstraintsBuilder.buildFinalResult([constraint])) == [constraint]
}
}
19 changes: 19 additions & 0 deletions Tests/LayoutTests/LayoutBuilderTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -22,34 +22,53 @@ final class LayoutBuilderTests: XCTestCase {

// THEN

// Build Expression With None and Layout Item

expect(LayoutBuilder.buildExpression(Optional<LayoutItem>.none)).to(beEmpty())
expect(LayoutBuilder.buildExpression(layoutItem) === [layoutItem]) == true

// Build Expression With None and Layout Item Array

expect(LayoutBuilder.buildExpression(Optional<[LayoutItem]>.none)).to(beEmpty())
expect(LayoutBuilder.buildExpression([layoutItem]) === [layoutItem]) == true

// Build Block With No Input and Layout Item Array

expect(LayoutBuilder.buildBlock()).to(beEmpty())
expect(LayoutBuilder.buildBlock([layoutItem]) === [layoutItem]) == true

// Build Block With Layout Item Arrays

expect(LayoutBuilder.buildBlock([layoutItem], [layoutItem], [layoutItem]) === [
layoutItem,
layoutItem,
layoutItem
]) == true

// Build Optional With Nil and Layout Item Array

expect(LayoutBuilder.buildOptional(nil)).to(beEmpty())
expect(LayoutBuilder.buildOptional([layoutItem]) === [layoutItem]) == true

// Build Either With First and Second Layout Item Array

expect(LayoutBuilder.buildEither(first: [layoutItem]) === [layoutItem]) == true
expect(LayoutBuilder.buildEither(second: [layoutItem]) === [layoutItem]) == true

// Build Array With Array of Layout Item Arrays

expect(LayoutBuilder.buildArray([[layoutItem], [layoutItem], [layoutItem]]) === [
layoutItem,
layoutItem,
layoutItem
]) == true

// Build Limited Availability With Layout Item Array

expect(LayoutBuilder.buildLimitedAvailability([layoutItem]) === [layoutItem]) == true

// Build Final Result With Layout Item Array

expect(LayoutBuilder.buildFinalResult([layoutItem]) === [layoutItem]) == true
}
}
Loading