private static void TheLegacyCodeToTest(IDependencyInterface legacyDependency) { var result = legacyDependency.Call1(); legacyDependency.Call2("test"); legacyDependency.Call1(); legacyDependency.Call2("test" + result); if (result > 4) { legacyDependency.Call3("some more arguments", 4); } else { legacyDependency.Call4(new ClassWithMultiLineToString()); } }
public static void addDependencyType(IDependencyInterface depInterface) { string extensionList = depInterface.getExtensions(); while (!string.IsNullOrEmpty(extensionList)) { string extension; int posOfComma = extensionList.IndexOf(','); if (posOfComma == -1) { extension = extensionList.TrimEnd(null); extensionList = null; } else { extension = extensionList.Remove(posOfComma).TrimEnd(null); extensionList = extensionList.Remove(0, posOfComma); extensionList = extensionList.TrimStart(','); } supportedExtensions.Add(extension, depInterface); } }