kswoll / ReactiveUI.Fody

C# Fody extension to generate RaisePropertyChange notifications for properties and ObservableAsPropertyHelper properties.
MIT License
154 stars 31 forks source link

Using ReactiveUI.Fody with property initialisers result in unit tests looking for backing fields #18

Closed mmamone closed 8 years ago

mmamone commented 8 years ago

We are using ReactiveUI.Fody with C#6, so are taking advantage of property initialisers. If we have the following code :

[ReactiveUI]
public ObservableCollection<int> {get;set;} = new ObservableCollection<int>();

The unit tests (that use AutoMocker) fail to run, as they are searching for the backing field (not explicitly). If, however, we initialise the property in the constructor, the problem goes away (but we lose the usage of property initialisers).

kswoll commented 8 years ago

@mmamone sorry, this issue slipped my notice! I'll take a look this weekend.

kswoll commented 8 years ago

@mmamone can you elaborate on what the error is? Are you suggesting that AutoMocker is relying on the specific compiler-generated names for the backing fields? But yeah, whatever error message/stack trace you could provide would be a big help.

kswoll commented 8 years ago

Closing, but will re-open if more details emerge.