public void ChangeAll() { Modify .This(something) .ChangeAll(); var changed = 0; if (something.MyProperty != -42) { changed++; } if (something.MyOtherProperty != -42) { changed++; } if (something.AnotherProperty != -42) { changed++; } if (something.YetAnotherProperty != -42) { changed++; } Assert.Equal(4, changed); }
public void Change() { Modify .This(something) .Change(s => s.MyProperty); Assert.NotEqual(-42, something.MyProperty); Assert.Equal(-42, something.MyOtherProperty); Assert.Equal(-42, something.AnotherProperty); Assert.Equal(-42, something.YetAnotherProperty); }
public void ChangeReallyMeansChange() { var something = Generate.One <WithBoolProperty>(); 10.Times( () => { var before = something.MyPropery; Modify.This(something).Change(e => e.MyPropery); Assert.NotEqual(before, something.MyPropery); } ); }