Possible bug with private property read?

2 posts, 0 answers
  1. Mark
    Mark avatar
    6 posts
    Member since:
    Aug 2010

    Posted 29 Apr 2015 Link to this post

     Mock.NonPublic.Arrange<int>(mockedClass, "_prop").Returns(5);

    Works as long as my private variable is setup like so:

    private int _prop {get; set;}

    However these:

    private int _prop; 

    or 

    private int _prop = 5;

    get an error attempting to read it. 

     

     

    Thanks in advance, 

    Mark 

     

  2. Mark
    Mark avatar
    6 posts
    Member since:
    Aug 2010

    Posted 30 Apr 2015 in reply to Mark Link to this post

    Already know my own answer..
    Backing fields aren't properties... sigh sleep helped
Back to Top