Skip to content

Commit cb3593f

Browse files
author
Sharma Elanthiriayan
committed
OrderStoreTests
- Use `fake` and `copy` method to generate sample order tax lines.
1 parent e0692c4 commit cb3593f

File tree

1 file changed

+12
-29
lines changed

1 file changed

+12
-29
lines changed

Yosemite/YosemiteTests/Stores/OrderStoreTests.swift

Lines changed: 12 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -912,40 +912,23 @@ private extension OrderStoreTests {
912912
return [coupon1, coupon2]
913913
}
914914

915+
func sampleOrderTaxLine() -> Networking.OrderTaxLine {
916+
OrderTaxLine.fake().copy(taxID: 1330,
917+
rateCode: "US-NY-STATE-2",
918+
rateID: 6,
919+
label: "State",
920+
totalTax: "7.71",
921+
ratePercent: 4.5)
922+
}
923+
915924
func sampleOrderTaxLines() -> [Networking.OrderTaxLine] {
916-
[
917-
.init(taxID: 1330,
918-
rateCode: "US-NY-STATE-2",
919-
rateID: 6,
920-
label: "State",
921-
isCompoundTaxRate: true,
922-
totalTax: "7.71",
923-
totalShippingTax: "0.00",
924-
ratePercent: 4.5,
925-
attributes: [])
926-
]
925+
[sampleOrderTaxLine()]
927926
}
928927

929928
func sampleOrderTaxLinesMutated() -> [Networking.OrderTaxLine] {
930929
[
931-
.init(taxID: 1330,
932-
rateCode: "US-NY-STATE-2",
933-
rateID: 6,
934-
label: "State",
935-
isCompoundTaxRate: true,
936-
totalTax: "55",
937-
totalShippingTax: "0.00",
938-
ratePercent: 5.5,
939-
attributes: []),
940-
.init(taxID: 124,
941-
rateCode: "",
942-
rateID: 2,
943-
label: "Central",
944-
isCompoundTaxRate: true,
945-
totalTax: "2.5",
946-
totalShippingTax: "3",
947-
ratePercent: 2.5,
948-
attributes: [])
930+
sampleOrderTaxLine().copy(totalTax: "55", ratePercent: 5.5),
931+
OrderTaxLine.fake()
949932
]
950933
}
951934

0 commit comments

Comments
 (0)