Skip to content
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

Unit Testing v8 #1627

Closed
Adolfi opened this issue Mar 20, 2019 · 10 comments
Closed

Unit Testing v8 #1627

Adolfi opened this issue Mar 20, 2019 · 10 comments

Comments

@Adolfi
Copy link
Contributor

Adolfi commented Mar 20, 2019

What type of issue is it?

Missing documentation

What article/section is this about?

Unit Testing

Describe the issue:

It would be great if there where a section in the documentation on how to get started with unit testing in Umbraco. For instance how to unit test:

  • RenderMvcControllers
  • SurfaceControllers
  • IPublishedContent
  • etc.

There are great blog posts on this topic scattered around the internet, but it would be great if there where an official "recommended" approach on how to get started.

I think Unit Testing should should be easy to get started with and with as little mocking as possible, and for someone new to Umbraco i dont think one should have to fork the UmbracoCms and examine how the tests have been written there, but instead there should be easy to find docs available to get started. Maybe some basic examples of how to test the examples mentioned on custom-controllers section?: https://our.umbraco.com/documentation/reference/routing/custom-controllers

Take care!

@Adolfi
Copy link
Contributor Author

Adolfi commented Mar 27, 2019

@jmayntzhusen
Copy link
Contributor

Hey @Adolfi

I agree this would be a great thing to have documented, I can see you already posted some examples on the forum thread - would you be up for contributing to the documentation by writing this article?

We can of course help with the correct placement, file setup and a review by one of the Umbraco Core developers 🙂 This would speed up the documenting process quite a bit.

@Adolfi
Copy link
Contributor Author

Adolfi commented Mar 27, 2019

Hi @jmayntzhusen.
I would be happy to. It would however be great to have someone verify that I'm on the right track since this is just what I've figured out for myself since there where no docs available.

If you could have a core memeber verify my post in the our forum thread and confirm that my implementation would be concidered a "best practice", then I would be happy to write the docs or at least get it started.

Cheeers

@jmayntzhusen
Copy link
Contributor

Awesome, I asked @bergmania to have a look at the forum post, and he confirms that what you posted is correct and the basic way to do it 👍🙂

Do you need anything else to get started?

@Adolfi
Copy link
Contributor Author

Adolfi commented Mar 27, 2019

Wow, that was fast. Thanks, and great to hear that it was an acceptet approach.
I have quite a few different Tests already for the mentioned topics (RenderMvcControllers, SurfaceControllers, IPublishedContent) so I think I have a lot go get started.

One question: Do you think it should be a "Documentation" and live under the "Implementation" area or should it be constructed as a "Tutorial" instead? Like "Getting started with Unit Testing"?
Since not everyone are doing unit tests, it might be concidered a tutorial? Either way works for me, it's just good to know before starting to write it so I know how to frase myself.

@jmayntzhusen
Copy link
Contributor

I think either would be fine, normally tutorials are a bit more in depth and should also explain the concept to those who don't know anything about the subject though, so they require a bit more explanations and steps.

It depends what you wish to do, if you would like to just put the code examples out there then I would say it should be in the Implementation section 🙂

@Adolfi
Copy link
Contributor Author

Adolfi commented Mar 27, 2019

Awesome, thanks. Sounds like docs then and not a tutorial. :)
I'll start working on it and send a PR.

Cheers!

@Adolfi
Copy link
Contributor Author

Adolfi commented May 24, 2019

Better late than never. :) #1711

@jmayntzhusen
Copy link
Contributor

Will close this for now, thanks again! 🎉

@Adolfi
Copy link
Contributor Author

Adolfi commented May 27, 2019

Thank you!!! ❤️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants