public void Sync_ShouldWorkWhenEnabled() { using (new SyncAnimalsAndLimbs()) { var animal = new Animal(); animal.Limbs.Count.Should().Be(0); var frontLeft = new Limb("Front Left", animal); animal.Limbs.Count.Should().Be(1); var frontRight = new Limb("Front Right", animal); animal.Limbs.Count.Should().Be(2); frontRight.Animal.Value = Option.Mempty<Animal>(); animal.Limbs.Count.Should().Be(1); animal.Limbs.Remove(frontLeft); animal.Limbs.Count.Should().Be(0); } }
public Limb(string name, Animal animal) { Animal = new ReactiveProperty<Option<Animal>>(() => animal); Name = new ReactiveProperty<string>(name); this.Constructed(); }