public void when_attempting_to_version_a_property_bag()
{
var originalAddress = "12345 Fake Street";
var subscriber = new SimpleMementoingClass()
{
Domainees = new List<DomainPropertyBag>()
{
new DomainPropertyBag(),
new DomainPropertyBag()
},
ChiefDomainee = new DomainPropertyBag(),
Address = originalAddress,
FirstName = "If only Customer Objects",
LastName = "were ever this simple"
};
var mementor = new Mementor();
var newAddress = "Changed Address!";
mementor.PropertyChange(subscriber, () => subscriber.Address);
//ohhh typing is a little weak here.
subscriber.Address = newAddress; //ahh, note the order matters of course.
subscriber.Address.Should().Be(newAddress);
mementor.Undo();
//and I cant undo specific changes, just the last one.
subscriber.Address.Should().Be(originalAddress);
//still, very cool.
//In terms of a deployed program, this is tough to implement.
//I like the pub-sub design of it, code is superbly clean.
}