public void WhenPropertyWithDifferentBackFieldMatch() { var pattern = new PropertyToFieldPattern(); var member = typeof(MyClass).GetProperty("WithDifferentBackField"); pattern.Match(member).Should().Be.True(); }
public void WhenSetOnlyPropertyNoMatch() { var pattern = new PropertyToFieldPattern(); var member = typeof(MyClass).GetProperty("SetOnlyProperty"); pattern.Match(member).Should().Be.False(); }
public void WhenPropertyWithoutFieldNoMatch() { var pattern = new PropertyToFieldPattern(); var member = typeof(MyClass).GetProperty("PropertyWithoutField"); pattern.Match(member).Should().Be.False(); }
public void WhenFieldNoMatch() { var pattern = new PropertyToFieldPattern(); var member = typeof (MyClass).GetField("aField", BindingFlags.Instance | BindingFlags.NonPublic | BindingFlags.DeclaredOnly); pattern.Match(member).Should().Be.False(); }
public void WhenFieldNoMatch() { var pattern = new PropertyToFieldPattern(); var member = typeof(MyClass).GetField("aField", BindingFlags.Instance | BindingFlags.NonPublic | BindingFlags.DeclaredOnly); pattern.Match(member).Should().Be.False(); }
public void WhenReadOnlyPropertyWithSameBackFieldNoMatch() { var pattern = new PropertyToFieldPattern(); var member = typeof(MyClass).GetProperty("ReadOnlyWithSameBackField"); pattern.Match(member).Should().Be.False(); }