Skip to content

Refactor library into sub libraries #75

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
2 tasks done
egil opened this issue Mar 19, 2020 · 4 comments
Closed
2 tasks done

Refactor library into sub libraries #75

egil opened this issue Mar 19, 2020 · 4 comments
Assignees
Labels
enhancement New feature or request

Comments

@egil
Copy link
Member

egil commented Mar 19, 2020

To make it easier to maintain and extend the library with support for other Blazor project types and testing library types (e.g. nUnit), I want to separate the library in to the following:

  • bunit.core
  • bunit.web (this will include JSInterop mocking, since that is web specific)
  • bunit.xamarinforms or bunit.mobile (not part of the initial refactor)
  • bunit.xunit
  • bunit.nunit (not part of the initial refactor)
  • bunit.mstest (not part of the initial refactor)
  • bunit (default project, that just includes bunit.core, bunit.web. and bunit.xunit, to stay 100% compatible with current package)

Dependencies in each project should then be:

  • bunit.core
    • Blazor
  • bunit.web
    • bunit.core
  • bunit.xamarinforms
    • bunit.core
  • bunit.xunit
    • bunit.core
    • xunit.core
  • bunit.nunit
    • bunit.core
    • nunit
  • bunit.mstest
    • bunit.core
    • mstest2
  • bunit
    • bunit.core
    • bunit.web
    • bunit.xunit

The new folder structure should be:

  • docs
  • sample
  • src
    • bunit
    • bunit.core
    • bunit.core.tests
    • bunit.web
    • bunit.web.tests
    • bunit.xunit
    • bunit.xunit.tests
      ...
  • template

TODO

  • Reorder into new projects
  • Tweak dependencies (xunit major version dep only)

closes #5

@egil egil added the enhancement New feature or request label Mar 19, 2020
@egil egil self-assigned this Mar 19, 2020
@StefH
Copy link
Contributor

StefH commented Mar 19, 2020

Good idea.

Maybe just deprecate bunit. Only the early adopters used this preview version. So no harm in refactoring here.

And if you build any library, make sure that the required dependencies are as low as possible. (For example I noticed that bunit.xunit required the latest version from xunit, which means in my case updating my test projects to match that xunit version)

@egil
Copy link
Member Author

egil commented Mar 19, 2020

@StefH good point StefH. I am trying to figure out how to best manage dependencies. Ideally, my dependencies will be more limited going forward, and only depend on major versions of a library, if possible, or at the required long-term support version, in aspnetcore's case.

My idea with keeping the bunit package around is inspired by xunit. They have a similar setup, where if you just install xunit, you get a bunch of other packages that you are very likely to need. That makes it easier to get started. More advanced scenarios allow you to pick only xunit.core and xunit.assert and skip other parts.

@StefH
Copy link
Contributor

StefH commented Mar 19, 2020

@egil Sorry, maybe a stupid question from my side : why do you actually need xunit as dependency ?
And what is the reason you use Shouldy and not FluentAssertions?

@egil
Copy link
Member Author

egil commented Mar 19, 2020

For the razor based tests and snapshot tests, I need a test runner, unless I create my own, which is quite a bit of work. If you are only writing c# based tests, then you will, when this is done, just be able to pick the bunit.web library, and use whatever test framework to run the tests you want.

There should only be a dependency on Shouldly in the test project for bunit. I use that simply because I like the vocabulary it comes with.

ps. there are no stupid questions, ask away.

@egil egil added this to the beta-7 milestone Apr 3, 2020
@egil egil closed this as completed Apr 25, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants