This project is read-only.

Audit

Implements INotifyMemberAccess and reports every method invocation, including getting/setting property values and adding/removing event handlers.

IAccount account = session.Account;

IAccount auditableAccount = Build.Audit<IAccount>(account);
INotifyMemberAccessed auditable = auditableAccount as INotifyMemberAccessed;
auditable.MemberAccessed += new EventHandler<MemberAccessedEventArgs>(OnMemberAccessed);

auditableAccount.Balance += 10; // will raise first get and then set
auditableAccount.Suspend(); // will raise Suspend

Disable

Disables specified methods on an instance.

Implement

Creates an instance that implements the specified interface.

IArticle mock = Build.Implement<IArticle>();
mock.Title = "Instance for testing";
mock.Published = DateTime.Now;

LoadBalance

Distributes operations across multiple instances.

IService s1, s2, s3;
IService loadBalancer = Build.LoadBalance<IService>(s1, s2, s3);
loadBalancer.DoWork(1);
loadBalancer.DoWork(2);
loadBalancer.DoWork(3);

Multicast

Handles multiple objects as one, performs every operation on each object.

IRecipient[] recipients = session.Recipients;
IRecipient all = Build.Multicast<IRecipient>(recipients);
all.Say("Hello");

NotifyPropertyChanged

Implements INofityPropertyChanged on any kind of object and reports every property change.

IArticle article = Build.NotifyPropertyChanged<IArticle>(DataContext.Repository<IArticle>().Get("first"));
viewModelPresenter.DataContext = article;
article.Title = "Changed Title";

Override

Overrides specific methods on an instance.

Snapshot

Creates a snapshot of an object.

IState snapshot = Build.Snapshot<IState>(stream.ContinuouslyChangingState);
Console.WriteLine(snapshot.Timestamp);
Console.WriteLine(snapshot.Value);

Last edited Aug 10, 2013 at 10:00 AM by BlueCode, version 4

Comments

No comments yet.