コード例 #1
0
        public void FieldOrderDoesNotAffectHashCode()
        {
            var list1 = DamlList.Of(new Int64(12345), new Party("party1"), new Bool(false));
            var list2 = DamlList.Of(new Party("party1"), new Int64(12345), new Bool(false));

            Assert.True(list1.GetHashCode() == list2.GetHashCode());
        }
コード例 #2
0
        private void ConvertThroughProto(DamlList source)
        {
            Com.Daml.Ledger.Api.V1.Value protoValue = source.ToProto();
            var maybe = Value.FromProto(protoValue).AsList();

            maybe.Should().BeOfType <Some <DamlList> >();
            Assert.True(source == (Some <DamlList>)maybe);
        }
コード例 #3
0
        private void ConvertThroughProto(DamlList source)
        {
            Com.DigitalAsset.Ledger.Api.V1.Value protoValue = source.ToProto();
            var maybe = Value.FromProto(protoValue).AsList();

            Assert.AreEqual(typeof(Some <DamlList>), maybe.GetType());
            Assert.IsTrue(source == (Some <DamlList>)maybe);
        }
コード例 #4
0
        public void FieldOrderDoesNotAffectEquality()
        {
            var list = DamlList.Of(ValuesFactory.Values1.Reverse());

            Assert.True(_list1.Equals(list));
        }
コード例 #5
0
 public void CanConvertBetweenProto()
 {
     ConvertThroughProto(_list1);
     ConvertThroughProto(DamlList.Of(new Value[] {}));
 }