lundi 16 février 2015

Efficient way of replacing static method (200+) calls with non-static

I was fixing a bug in our system. Here are the facts:



  1. The bug sits in a method Yum() in a sealed class Noodles.

  2. Bug method Yum() is a static method.

  3. Yum() method is used 200+ times across code base.

  4. Sealed class Noodles does implement a interface.


My question is that what is the best way of replacing the static method call with non-static calls without risking that it might break other code.


I want also be able to test Noodles class. As it is a sealed class and method is static, mocking option is out of window.


Thanks in advance.


Aucun commentaire:

Enregistrer un commentaire