Published on NuGet
I needed to clean up testing of INotifyPropertyChanged implementations in an application I'm working on. Seikilos' Gist inspired me, kudos. I use FakeItEasy and have altered the usage quite a bit by adopting their MustHave(Repeated) fluent syntax to be more consistent.
I'm only dabbling with Git having been an SVN user for many years. Hopefully I'm not stepping on any toes or doing anything incorrect!
```csharp ITraceable target = A.Fake(); A.CallTo(target).Where(x => x.Method.Name == "set_Active") .Invokes(() => { target.PropertyChanged += Raise.With(new PropertyChangedEventArgs("Active")).Now; });var tracer = new InpcTracer.InpcTracer(target);
<h5>
<b>Check for one event</b>
</h5>
```csharp
Assert.IsTrue(tracer.WhileProcessing(() => target.Active = true)
.RecordedEvent(() => target.Active)
.ExactlyOnce());
// or
tracer.WhileProcessing(() => target.Active = true)
.RecordedEvent(() => target.Active)
.MustHaveHappened(Repeated.Exactly.Once);