public async Task ToRpc_Collection_Long_With_Capabilities_Value()
        {
            var logger       = MockNullLoggerFactory.CreateLogger();
            var capabilities = new Capabilities(logger);
            MapField <string, string> addedCapabilities = new MapField <string, string>
            {
                { RpcWorkerConstants.TypedDataCollection, RpcWorkerConstants.TypedDataCollection }
            };

            capabilities.UpdateCapabilities(addedCapabilities);
            long[]    arrLong           = { 1L, 2L };
            TypedData returned_typedata = await arrLong.ToRpc(logger, capabilities);

            TypedData        typedData      = new TypedData();
            CollectionSInt64 collectionLong = new CollectionSInt64();

            foreach (long element in arrLong)
            {
                collectionLong.Sint64.Add(element);
            }
            typedData.CollectionSint64 = collectionLong;

            Assert.Equal(typedData.CollectionSint64, returned_typedata.CollectionSint64);
            Assert.Equal(typedData.CollectionSint64.Sint64[0], returned_typedata.CollectionSint64.Sint64[0]);
        }
예제 #2
0
        internal static TypedData ToRpcLongArray(this long[] arrLong)
        {
            TypedData        typedData      = new TypedData();
            CollectionSInt64 collectionLong = new CollectionSInt64();

            foreach (long element in arrLong)
            {
                collectionLong.Sint64.Add(element);
            }
            typedData.CollectionSint64 = collectionLong;

            return(typedData);
        }