public void Simple()
 {
     using (One<Animal>.ToMany<Limb>.Setup().Connect(
         animal => animal.Limbs,
         limb => limb.Animal))
     {
         var animal = new Animal();
         animal.Limbs.Count.Should().Be(0);
         new Limb("Front Left", animal);
         animal.Limbs.Count.Should().Be(1);
         new Limb("Front Right", animal);
         animal.Limbs.Count.Should().Be(2);
     }
 }
 public void Customizable()
 {
     using (One<Animal>.ToMany<Limb>.Setup().Connect(
         animal => animal.Limbs,
         limb => limb.Animal,
         EnsureContains, EnsureContainsNot))
     {
         var animal = new Animal();
         animal.Limbs.Count.Should().Be(0);
         new Limb("Front Left", animal);
         animal.Limbs.Count.Should().Be(1);
         new Limb("Front Right", animal);
         animal.Limbs.Count.Should().Be(2);
     }
 }
 public Limb(string name, Animal animal)
 {
     Animal = animal;
     Name = name;
     this.Constructed();
 }
 private void EnsureContains(Animal arg1, Limb arg2)
 {
     if (!arg1.Limbs.Contains(arg2))
         arg1.Limbs.Add(arg2);
 }
 private void EnsureContainsNot(Animal arg1, Limb arg2)
 {
     if (arg1.Limbs.Contains(arg2))
         arg1.Limbs.Remove(arg2);
 }