-
Notifications
You must be signed in to change notification settings - Fork 167
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from serena0720/step1
merge step1 to main
- Loading branch information
Showing
10 changed files
with
179 additions
and
69 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
// | ||
// FruitStoreError.swift | ||
// JuiceMaker | ||
// | ||
// Created by Minsup, Serena on 2023/05/09. | ||
// | ||
|
||
enum FruitStoreError: Error { | ||
case notFoundFruit(Fruit) | ||
case notEnoughStock(Fruit) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
// | ||
// Fruit.swift | ||
// JuiceMaker | ||
// | ||
// Created by Minsup, Serena on 2023/05/09. | ||
// | ||
|
||
enum Fruit: String { | ||
case strawberry = "딸기" | ||
case banana = "바나나" | ||
case pineapple = "파인애플" | ||
case kiwi = "키위" | ||
case mango = "망고" | ||
|
||
var name: String { | ||
self.rawValue | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
// | ||
// Juice.swift | ||
// JuiceMaker | ||
// | ||
// Created by Minsup, Serena on 2023/05/09. | ||
// | ||
|
||
enum Juice: String { | ||
case strawberryJuice = "딸기쥬스" | ||
case bananaJuice = "바나나쥬스" | ||
case kiwiJuice = "키위쥬스" | ||
case pineappleJuice = "파인애플쥬스" | ||
case strawberryBananaJuice = "딸바쥬스" | ||
case mangoJuice = "망고쥬스" | ||
case mangoKiwiJuice = "망고키위쥬스" | ||
|
||
var name: String { | ||
self.rawValue | ||
} | ||
|
||
var recipe: Recipe { | ||
switch self { | ||
case .strawberryJuice: | ||
return [(fruit: .strawberry, amount: 16)] | ||
case .bananaJuice: | ||
return [(fruit: .banana, amount: 2)] | ||
case .kiwiJuice: | ||
return [(fruit: .kiwi, amount: 3)] | ||
case .pineappleJuice: | ||
return [(fruit: .pineapple, amount: 2)] | ||
case .strawberryBananaJuice: | ||
return [(fruit: .strawberry, amount: 10), (fruit: .banana, amount: 1)] | ||
case .mangoJuice: | ||
return [(fruit: .mango, amount: 3)] | ||
case .mangoKiwiJuice: | ||
return [(fruit: .mango, amount: 2), (fruit: .kiwi, amount: 1)] | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.