public void CanIncrement_Numeric() { var subject = new Test001(); var incrementor = new LambdaPropertyIncrementorStrategy().CreateNumericIncrementor <Test001>( typeof(Test001).GetProperty("Version") ); for (var a = 0; a < 1024; a++) { Assert.AreEqual(a, subject.Version); incrementor(subject); } }
public void CanIncrement_Binary() { var subject = new Whisker() { Version = new byte[] { 0, 0, 0, 0, 0, 0, 0, 0 } }; var incrementor = new LambdaPropertyIncrementorStrategy().CreateBinaryIncrementor <Whisker>( typeof(Whisker).GetProperty("Version"), 8 ); for (var a = 0; a < 1024; a++) { var version = new byte[] { 0, 0, 0, 0, 0, 0, 0, 0 }; Array.Copy(subject.Version, version, version.Length); Array.Reverse(version); Assert.AreEqual(a, BitConverter.ToInt64(version, 0)); incrementor(subject); } }