Example #1
0
        public void WhenPropertyWithDifferentBackFieldMatch()
        {
            var pattern = new PropertyToFieldPattern();
            var member  = typeof(MyClass).GetProperty("WithDifferentBackField");

            pattern.Match(member).Should().Be.True();
        }
Example #2
0
        public void WhenSetOnlyPropertyNoMatch()
        {
            var pattern = new PropertyToFieldPattern();
            var member  = typeof(MyClass).GetProperty("SetOnlyProperty");

            pattern.Match(member).Should().Be.False();
        }
Example #3
0
        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();
 }
Example #5
0
        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 WhenSetOnlyPropertyNoMatch()
 {
     var pattern = new PropertyToFieldPattern();
     var member = typeof(MyClass).GetProperty("SetOnlyProperty");
     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();
 }
 public void WhenPropertyWithDifferentBackFieldMatch()
 {
     var pattern = new PropertyToFieldPattern();
     var member = typeof(MyClass).GetProperty("WithDifferentBackField");
     pattern.Match(member).Should().Be.True();
 }