LeNelSoN / you-are-the-hero

L'API dont vous êtes le héros is an interactive Java API that brings the adventure of "choose your own adventure" stories to life. Users can embark on unique journeys, make decisions at each step, and create dynamic narratives, all while experiencing the nostalgia of classic adventure books.
GNU General Public License v3.0
2 stars 10 forks source link

Write Unit Tests for StoryService #8

Closed LeNelSoN closed 1 month ago

LeNelSoN commented 1 month ago

Quest:

Develop unit tests for the StoryService class to ensure that story creation and scene management functionalities work as expected.

Tasks:

  • [ ] Verify that a new story can be created and saved successfully.
  • [ ] Ensure that the method throws an exception when trying to save a story with invalid data (if applicable).
  • [ ] Test successful addition of a scene to a story when the story exists and has no first scene.
  • [ ] Validate that it throws SceneAlreadyExistsException if a scene already exists for that story.
  • [ ] Ensure that it throws StoryNotFoundException if the story does not exist.
  • [ ] Check that it throws IllegalArgumentException if the story ID or scene is null.
  • [ ] Verify that all stories can be retrieved correctly from the repository.
  • [ ] Test retrieval of a story by its ID when it exists.
  • [ ] Validate that it throws StoryNotFoundException when the story does not exist.
  • [ ] Ensure that it throws IllegalArgumentException if the story ID is null or empty.

image

The keeper of the repo 🏰

fmwalle commented 1 month ago

I would like to work on this Sir

LeNelSoN commented 1 month ago

Hi @fikirWalle ,

Thank you so much for contributing to improving the unit tests! 🙏 Feel free to add any additional test cases if you think they are necessary to cover more scenarios or enhance the robustness of the project. Any improvement in this regard is greatly appreciated.

If you have any questions or need clarification, don’t hesitate to reach out. I'm here to help.

Thanks again for your support!

The keeper of the repo 🏰

fmwalle commented 1 month ago

Hi LeNelson, Thank you for the opportunity. I apologize for the delayed response. Please find the changes I made today.

LeNelSoN commented 1 month ago

Thank you for your contribution! 🙌 I'll be reviewing your PR very soon. In the meantime, feel free to check out the changes made and the new issues that have been added. Don’t hesitate to reach out if you have any questions or feedback. 😊