Задайте вопросЗадайте вопрос
 

ОтвеченоAre list accessors working in 2008?

  • 2 сентября 2008 г. 19:10EricAll Медали пользователяМедали пользователяМедали пользователяМедали пользователяМедали пользователя
     

    Hello-

     

    I just finished running through the TFS intro labs, and decided to try making a new unit test.  The Board class in the TicTacToe example exposes a Cells property that's of type List<Cell>.  Both this property and the Cell type are internal to the app assembly, so I right-clicked in the Board's editor and said "Create Private Accessor" like the demos suggested.

     

    In my unit test, I then added:

    Board_Accessor board = new Board_Accessor();

     

    Cool so far, but the next line will throw a type cast exception:

    object cell = board.Cells[3];

     

    It seems that the generated List<Cell_accessor> and the original List<Cell> types are not compatible.

     

    Is this expected?  Is there a workaround?

    Thanks,

    Eric

Ответы

Все ответы