Code2Gether-Discord / Code2Gether-Discord-Bot

A Discord bot for the Code2Gether server
3 stars 1 forks source link

[User Story] As a Developer, I want better unit tests on logical classes to reduce the chance of re-introducing a bug #30

Open srjheam opened 3 years ago

srjheam commented 3 years ago

As previously discussed in #29, improving tests and reducing code repetition is increasingly necessary.

nickmartin1ee7 commented 3 years ago

A unit test where attempting to add two projects would be beneficial.

srjheam commented 3 years ago

A unit test where attempting to add two projects would be beneficial.

Thanks, I'll make sure to do that.

srjheam commented 3 years ago

I was basing my tests on Code2Gether-Discord-Bot.Library.Models.ProjectManager class but this class is always called by Code2Gether-Discord-Bot.Library.BusinessLogic namespace's classes, so @nickmartin1ee7 I'd to know whether should I basing my tests in each BusinessLogic classes, ProjectManager classes or both?

nickmartin1ee7 commented 3 years ago

Specifically I am testing the logic for the commands in #29. However, ProjectManager should probably have tests too. But that is something that can be improved in a different branch for this story.

srjheam commented 3 years ago

ATM I'm writing the tests for the Model.ProjectManager class and refactoring the way to create fake/mock/stub objects. I'm gonna share my work soon.

srjheam commented 3 years ago

Why was this problem closed, @nickmartin1ee7? I thought it was about refactoring all the tests, at least I was doing it.

nickmartin1ee7 commented 3 years ago

Closed automatically. Reopening.