private static void coverGeneratedCodeCRUDOperations()
        // Null Web Service mock implementation
        System.Test.setMock(WebServiceMock.class, new WebServiceMockImpl());
        // Only required to workaround a current code coverage bug in the platform
        MetadataService metaDataService = new MetadataService();
        // Invoke operations         
        MetadataService.MetadataPort metaDataPort = new MetadataService.MetadataPort();
  • 2
    This is not a question. – Adrian Larson Mar 9 '16 at 15:53
  • Test Methods With No Assert result path 1: L 77: private static void coverGeneratedCodeCRUDOperations() – ravi Mar 9 '16 at 15:55
  • 1
    Dude, all you did was dump some code on here. Add some explanation and I will remove my down vote. – Adrian Larson Mar 9 '16 at 16:15
  • 1
    @ravi, dumping code and then dumping on the people who tried to help won't get your issues resolved. If you can't be bothered to be expansive and clear you really can't expect people to make the effort to help. – Sebastian Kessel Mar 9 '16 at 16:21
  • 2
    Hi Ravi, I request you to elaborate the question by editing it. When you provide sufficient information about the problem you are having, people will be ready to help you and will make sure that it gets solved. We welcome new people on SFSE and we respect everyone's opinion. Please edit your question and make it as detailed as you can. – manjit5190 Mar 9 '16 at 16:50

Asserts test the functionality of your code. Without them you are not actually testing, you just cover lines.

Below was taken from the docs:

A good way to tell if unit tests are properly verifying results is to look for liberal use of the System.assert() methods. If there aren’t any System.assert() method calls, then the tests aren’t verifying results properly. And, no, System.assert(true); doesn’t count.

You can find more here.

| improve this answer | |

It looks like you are using code from https://github.com/financialforcedev/apex-mdapi. If you are using the full MetadataService from there, I suggest you include the corresponding test class MetadataServiceTest which is also missing asserts but at least gets the coverage fairly high. If you have cut down the code then you would need to make a cut down version of the corresponding test.

In your justifying document for the missing asserts you can note that this is a relatively commonly used chunk of code that is an edit of the code generated by Salesforce's own tooling. It is just a data layer over a service and mocking that full service would be a huge undertaking.

| improve this answer | |

Not the answer you're looking for? Browse other questions tagged or ask your own question.