-12
@isTest
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();
}

closed as unclear what you're asking by AtulRajguru9, Adrian Larson, Ratan Paul, Jenny B, crmprogdev Mar 9 '16 at 17:44

Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.

  • 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
1

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.

0

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.

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