FakeItEasy - faking assignment

Viewed 307

I have Some code where I have a fake configuration root. I would like to check that a call is made to set a config value.

var fakeConfigRoot = A.Fake<IConfigurationRoot>();

//Do something that will set config item

//A call to set the config must have happened

It is possible to fake getting a config item using

 A.CallTo(() => fakeConfigRoot["TestConfigItem"]).MustHaveHappened(Repeated.Exactly.Once);

I would like to know if it is possible using FakeItEasy to fake the assignment of a config item and if so how. If it is not possible can anyone think of any workarounds.

1 Answers
Related