public void FromRecord_InvalidRecordType() { RecordKey key = new RecordKey(RecordType.Data, LedgerPath.Parse("/path/"), "name"); Record record = new Record(key.ToBinary(), ByteString.Empty, binaryData[1]); ArgumentOutOfRangeException exception = Assert.Throws<ArgumentOutOfRangeException>(() => AccountStatus.FromRecord(key, record)); Assert.Equal("key", exception.ParamName); }
public void FromRecord_InvalidRecordType() { RecordKey key = new RecordKey(RecordType.Data, LedgerPath.Parse("/path/"), "name"); Record record = new Record(key.ToBinary(), ByteString.Empty, binaryData[1]); ArgumentOutOfRangeException exception = Assert.Throws <ArgumentOutOfRangeException>(() => AccountStatus.FromRecord(key, record)); Assert.Equal("key", exception.ParamName); }
public static async Task<Record> GetRecord(this IStorageEngine store, RecordKey key) { IList<Record> result = await store.GetRecords(new[] { key.ToBinary() }); return result[0]; }