public void Members_ClassHasOneProperty_ReturnsOneProperty() { CreateProjectContent(); CreatePublicClass("MyClass"); AddPropertyToClass("MyClass.MyProperty"); global::EnvDTE.CodeElements codeElements = codeClass.Members; CodeProperty2 codeFunction = codeElements.FirstCodeProperty2OrDefault(); Assert.AreEqual(1, codeElements.Count); Assert.AreEqual("MyProperty", codeFunction.Name); }
public void Members_ClassHasOneProperty_ReturnsOneProperty() { CreateClass( "public class MyClass {\r\n" + " public int MyProperty { get; set; }\r\n" + "}"); global::EnvDTE.CodeElements codeElements = codeClass.Members; CodeProperty2 codeProperty = codeElements.FirstCodeProperty2OrDefault(); Assert.AreEqual(1, codeElements.Count); Assert.AreEqual("MyProperty", codeProperty.Name); }