public void Setter_NoSetter_ReturnsNull() { helper.CreatePublicProperty("MyProperty"); CreateCodeProperty2(); global::EnvDTE.CodeFunction setter = property.Setter; Assert.IsNull(setter); }
public void Setter_NoSetter_ReturnsNull() { CreateCodeProperty2( "class MyClass {\r\n" + " public int MyProperty { get { return 0; } }\r\n" + "}"); global::EnvDTE.CodeFunction setter = property.Setter; Assert.IsNull(setter); }
public void Getter_NoGetter_ReturnsNull() { CreateCodeProperty2( "class MyClass {\r\n" + " public int MyProperty { set { } }\r\n" + "}"); global::EnvDTE.CodeFunction getter = property.Getter; Assert.IsNull(getter); }
public void Setter_PublicPropertyButPrivateSetter_ReturnsPrivateSetterCodeFunction() { CreateCodeProperty2( "class MyClass {\r\n" + " public int MyProperty { get; private set; }\r\n" + "}"); global::EnvDTE.CodeFunction setter = property.Setter; global::EnvDTE.vsCMAccess access = setter.Access; Assert.AreEqual(global::EnvDTE.vsCMAccess.vsCMAccessPrivate, access); }
public void Getter_PrivateGetter_ReturnsPrivateGetterCodeFunction() { CreateCodeProperty2( "class MyClass {\r\n" + " private int MyProperty { get { return 0; } }\r\n" + "}"); global::EnvDTE.CodeFunction getter = property.Getter; global::EnvDTE.vsCMAccess access = getter.Access; Assert.AreEqual(global::EnvDTE.vsCMAccess.vsCMAccessPrivate, access); }
public void Setter_PublicPropertyButPrivateSetter_ReturnsPrivateSetterCodeFunction() { helper.CreatePublicProperty("MyProperty"); helper.HasGetterAndSetter(); helper.SetterModifierIsPrivate(); CreateCodeProperty2(); global::EnvDTE.CodeFunction setter = property.Setter; global::EnvDTE.vsCMAccess access = setter.Access; Assert.AreEqual(global::EnvDTE.vsCMAccess.vsCMAccessPrivate, access); }
public void Setter_PublicSetter_ReturnsPublicSetterCodeFunction() { helper.CreatePublicProperty("MyProperty"); helper.HasSetterOnly(); helper.SetterModifierIsNone(); CreateCodeProperty2(); global::EnvDTE.CodeFunction setter = property.Setter; global::EnvDTE.vsCMAccess access = setter.Access; Assert.AreEqual(global::EnvDTE.vsCMAccess.vsCMAccessPublic, access); }
public void Getter_PrivateGetter_ReturnsPrivateGetterCodeFunction() { helper.CreatePrivateProperty("MyProperty"); helper.HasGetterOnly(); helper.GetterModifierIsNone(); CreateCodeProperty2(); global::EnvDTE.CodeFunction getter = property.Getter; global::EnvDTE.vsCMAccess access = getter.Access; Assert.AreEqual(global::EnvDTE.vsCMAccess.vsCMAccessPrivate, access); }