is there a way to exclude code lines of all parent classes from jacoco coverage report without changing the code of the parent classes?
I'm using gradle.
Thanks!
Related
I have a custom navigation method that builds a new instance of a view. Unit tests for this method fail with the error message
System.InvalidOperationException: You must call Xamarin.Forms.Forms.Init(); prior to using this property.
I know that the listview in the view is causing it as the unit tests succeed when the listview is removed.
I have seen in older posts and blogs that this is because platformServices needs to be set but this cannot be set externally and the solutions point to github repositories or nuget packages that no longer exist or don't go into detail.
Any advice would be appreciated.
Developing an app I end up with some logic in my scoped model. My search does not show any examples on unit testing. Does anyone have an experience with in writing a test for scoped model? How can I mock lifecycle of the scoped model?
Not exactly sure of what you mean by the lifecycle...
But if you want to test Model startup, state changes and rebuilds of widgets (via Scoped Model) you should have a look at the actual unit tests of the Scoped Model repository.
Some good examples in there...
Scoped Model's unit tests
I'm using Visual Studio's Test Explorer with Machine.Specifications and would like to organize the tests by the Subject attribute. When organizing tests by trait, all the tests are grouped by Subject, but they are ALSO listed under the ClassName trait. That is to say, all tests with a Subject attribute will be displayed twice: once under the ClassName trait and once under the Subject trait. I would like to only display the Subject traits.
The search filter appears to allow you to show/hide tests which have a given filter (e.g. Search: Trait:"Subject", or -Trait:"Subject"), but it doesn't seem to be possible to only view tests under a specific trait. Is this possible?
I'm extending Django QuerySet by subclass (say MyQuerySet), and I would like to guarantee that my implementation does not break any existing functionality of QuerySet.
How can I test MyQuerySet against existing Django tests on QuerySet without having to replicate them?
For concreteness, let's consider the example of tests of prefetch_related, found in django/tests/prefetch_related package.
I would like to run all those tests on MyQuerySet. However, those tests are implemented using the default manager of the models in the package. Does anyone have any idea how to e.g. duck type objects to a custom manager that uses MyQuerySet?
I'm using Enterprise Architect and I wish to generate some class diagrams for a specific set of C++ objects within a massive project. By right clicking on a particular model and choosing Code Engineering from the context menu I can import the entire source directory for the project and generate class diagrams for all objects in the project.
I can also simply generate a class diagram for a single source file. However what I'd ideally like is to generate individual class diagrams for a particular set of files within the project (for example ones which only contain the text SNMP within their names). Can anyone help me apply this filter as the class diagram for the entire project is too large and unwieldy to manage in any capacity.
In Enterprise Architect once you have imported the entire model like you have already done you can create additional diagrams to show only the parts of the model you need. In fact I consider this normal practice.
First create a new diagram with Add->New View -> Class View & diagram.
Then drag only the classes you want from Model in the Project Browser onto the new Diagram.
If you comment your code using doxygen then you can generate these class diagrams automatically. Please look at our code at github/nvmecompliance/tnvme for example. I'm not sure if this directly applies to your case if the source code you are not going to modify..