I am currently diving into Test-Driven Development (TDD) and I'm facing a challenge on how to properly unit test a webservice that is called in JavaScript via AJAX. Although I've researched methods for mocking the AJAX call and individually testing the webservice, I realized that if someone else changes the parameters or their types in the webservice without updating the corresponding parameters in the AJAX call, the tests could still pass even with inconsistencies. Is there a way to create a connection between the two during testing so they are interdependent? Otherwise, just changing parameters in the webservice will not reflect any issues if the AJAX call continues as before.
Update:
The JS and C# tests are independent, meaning that if someone other than the test creator edits a C# method but neglects to update the associated AJAX call, the tests will still succeed, potentially masking errors until users encounter them.