public void Members_ClassHasOneMethod_ReturnsOneMethod() { CreateProjectContent(); CreatePublicClass("MyClass"); AddMethodToClass("MyClass.MyMethod"); global::EnvDTE.CodeElements codeElements = codeClass.Members; CodeFunction2 codeFunction = codeElements.FirstCodeFunction2OrDefault(); Assert.AreEqual(1, codeElements.Count); Assert.AreEqual("MyMethod", codeFunction.Name); }
public void Members_ClassHasOneMethod_ReturnsOneMethod() { CreateClass( "public class MyClass {\r\n" + " public void MyMethod() {}\r\n" + "}"); global::EnvDTE.CodeElements codeElements = codeClass.Members; CodeFunction2 codeFunction = codeElements.FirstCodeFunction2OrDefault(); Assert.AreEqual(1, codeElements.Count); Assert.AreEqual("MyMethod", codeFunction.Name); }