-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test/#470 : DailyMeal을 DailyMealFoods로 변경으로 인한 수정
- Loading branch information
1 parent
ae7ec5d
commit 6e42ad9
Showing
7 changed files
with
112 additions
and
85 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
37 changes: 37 additions & 0 deletions
37
BE/exceed/src/test/java/com/gaebaljip/exceed/application/domain/meal/DailyMealFoodsTest.java
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,37 @@ | ||
package com.gaebaljip.exceed.application.domain.meal; | ||
|
||
import static org.junit.jupiter.api.Assertions.*; | ||
|
||
import java.time.LocalDate; | ||
|
||
import org.junit.jupiter.api.Test; | ||
|
||
import com.gaebaljip.exceed.common.exception.meal.NotSameDateException; | ||
import com.gaebaljip.exceed.common.factory.DailyMealFoodsFixtureFactory; | ||
|
||
class DailyMealFoodsTest { | ||
|
||
@Test | ||
void when_mealSize_0_expected_return0() { | ||
DailyMealFoods dailyMealFoods = | ||
DailyMealFoodsFixtureFactory.create(LocalDate.now(), LocalDate.now(), 0); | ||
double calorie = dailyMealFoods.calculateCurrentCalorie(); | ||
assertEquals(calorie, 0.0); | ||
} | ||
|
||
@Test | ||
void when_mealSize_over0_and_sameDate_expected_return_success() { | ||
DailyMealFoods dailyMealFoods = | ||
DailyMealFoodsFixtureFactory.create(LocalDate.now(), LocalDate.now(), 3); | ||
assertDoesNotThrow(() -> dailyMealFoods); | ||
} | ||
|
||
@Test | ||
void when_mealSize_over0_and_NotSameDate_expected_return_exception() { | ||
assertThrows( | ||
NotSameDateException.class, | ||
() -> | ||
DailyMealFoodsFixtureFactory.create( | ||
LocalDate.now(), LocalDate.now().plusDays(2), 3)); | ||
} | ||
} |
35 changes: 0 additions & 35 deletions
35
BE/exceed/src/test/java/com/gaebaljip/exceed/application/domain/meal/DailyMealTest.java
This file was deleted.
Oops, something went wrong.
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
23 changes: 19 additions & 4 deletions
23
...d/common/factory/MealsFixtureFactory.java → ...factory/DailyMealFoodsFixtureFactory.java
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