private void ConvertThroughProto(LedgerOffset source) { Com.DigitalAsset.Ledger.Api.V1.LedgerOffset protoValue = source.ToProto(); LedgerOffset target = LedgerOffset.FromProto(protoValue); Assert.IsTrue(source == target); }
public void ProtoConversionOfLedgerBoundaryAbsolutesResolvesToledgerBoundaries() { var offsetBegin = LedgerOffset.FromProto(new LedgerOffset.Absolute(LedgerOffset.LedgerBegin.Instance.Offset).ToProto()); Assert.AreEqual(typeof(LedgerOffset.LedgerBegin), offsetBegin.GetType()); var offsetEnd = LedgerOffset.FromProto(new LedgerOffset.Absolute(LedgerOffset.LedgerEnd.Instance.Offset).ToProto()); Assert.AreEqual(typeof(LedgerOffset.LedgerEnd), offsetEnd.GetType()); }
public void ProtoConversionOfLedgerBoundaryAbsolutesResolvesToledgerBoundaries() { var offsetBegin = LedgerOffset.FromProto(new LedgerOffset.Absolute(LedgerOffset.LedgerBegin.Instance.Offset).ToProto()); offsetBegin.Should().BeOfType <LedgerOffset.LedgerBegin>(); var offsetEnd = LedgerOffset.FromProto(new LedgerOffset.Absolute(LedgerOffset.LedgerEnd.Instance.Offset).ToProto()); offsetEnd.Should().BeOfType <LedgerOffset.LedgerEnd>(); }