public int Transfer(Addressable source, long index, Substitute <T> destination) { if (source.Get(index) == 0) { destination.Add(inner.Name, () => null); return(1); } return(inner.Transfer(source, index + 1, destination) + 1); }
public void ShouldAccessRegisteredProperty() { Reflector reflector = new Reflector(); Serializer <Item> serializer = reflector.GetSerializer <Item>(); Addressable source = new MemoryMock(); Substitute <Item> data = new Substitute <Item>(serializer, source); data.Add("Value", () => 10); Assert.That(data.AsDynamic().Value, Is.EqualTo(10)); }
public int Transfer(Addressable source, long index, Substitute <Item> destination) { long sum = 0; for (int i = 0; i < value; i++) { sum = sum + source.Get(index + i); } destination.Add("Value", () => (byte)(sum / value / value)); return(value); }