Ejemplo n.º 1
0
 public virtual void CopyPropertiesFrom(Thing other)
 {
     this.StringProperty = other.StringProperty;
     this.BoolProperty = other.BoolProperty;
     this.DateProperty = other.DateProperty;
     this.IntProperty = other.IntProperty;
     this.DecimalProperty = other.DecimalProperty;
 }
 protected void AssertPropertiesMatch(Thing first, Thing second)
 {
     Assert.That(first.StringProperty, Is.EqualTo(second.StringProperty));
     Assert.That(first.BoolProperty, Is.EqualTo(second.BoolProperty));
     Assert.That(first.DateProperty, Is.EqualTo(second.DateProperty));
     Assert.That(first.IntProperty, Is.EqualTo(second.IntProperty));
     Assert.That(first.DecimalProperty, Is.EqualTo(second.DecimalProperty));
 }
 protected override void because()
 {
     var things = ThingBuilder.BuildSequence(2).ToList();
     original = things.First();
     other = things.Last();
     InNewSession(session => session.SaveOrUpdate(original));
     original.CopyPropertiesFrom(other);
     InNewSession(session => session.SaveOrUpdate(original));
     InNewSession(session => retrieved = session.Get<Thing>(original.Id));
 }
 protected override void because()
 {
     original = ThingBuilder.Build();
     InNewSession(session => session.SaveOrUpdate(original));
     InNewSession(session => retrieved = session.Get<Thing>(original.Id));
 }