swharden / QuickPlot

Experimental Plotting Library for .NET
MIT License
34 stars 6 forks source link

Unit tests #7

Closed StendProg closed 5 years ago

StendProg commented 5 years ago

Project have tests and it looks great. But it only use integration testing. Most of test check only for not throwing exceptions during full render loop. What do you think about "true" unit testing with dependency isolation, checking all possible function returns e.t.c .? Why did you choose MSTest framework? NUnit is most popular for .NET. Isolation framework also point to discass. I have a bit experience with NSubstitute. Good framework, but not most popular. I can make PR with example like i see it. But haven't idea how to setup AsurePiplines. Whad do you think about it?

swharden commented 5 years ago

What do you think about "true" unit testing with dependency isolation, checking all possible function returns e.t.c .?

I would really want this eventually, but I think it is too early.

I have already fully erased all my code and started over many times in the last few weeks: https://github.com/swharden/QuickPlot/tree/master/dev

Let's wait until the project stabilizes more. When it begins to feel solid, let's add extensive tests.

Why did you choose MSTest framework?

It was simplest, and it worked with Azure Pipelines immediately.

NUnit is most popular for .NET. Isolation framework also point to discuss. I have a bit experience with NSubstitute. Good framework, but not most popular. I can make PR with example like i see it. But haven't idea how to setup AsurePiplines. What do you think about it?

PR #8 does not seem to be working with Azure Pipelines. The config file (azure-pipelines.yml) might require modification to support NUnit, but I'm not familiar with this topic either. My preference is to continue to use MSTest until somebody knowledable can get NUnit (or something else) working with Azure Pipelines

EDIT: I added DotNetCoreCLI to the Azure Pipelines script and NUnit tests run

StendProg commented 5 years ago

EDIT: I added DotNetCoreCLI to the Azure Pipelines script and NUnit tests run

Thank you, very good job. I spent few hours trying to make it work, with zero result.

Additional there is good pattern to host tests in 2 different projects:

for easy separation of manual runs in IDE.

swharden commented 5 years ago

Thank you for creating a thorough set of tests for the Generate class! #10 This will serve as an excellent reference when writing tests for other classes.

Based on your suggestion I created two test projects, one for fast unit tests and the other for slow implementation tests (which will eventually include generation of the cookbook figures).

All tests run and pass (including on Azure Pipelines) so I think this issue can be closed and we can add tests as the QuickPlot API stabilizes.