Exemplo n.º 1
0
        private IOperationData GetServiceMetdata()
        {
            uint   count  = 0;
            IntPtr buffer = this.nativeOperation.GetServiceMetadata(out count);

            return(OperationData.CreateFromNative(count, buffer));
        }
Exemplo n.º 2
0
        private void RunTest(List <ArraySegment <byte> > input, Action <OperationData> validation)
        {
            // run the test with the IOperationData args
            var broker = new NativeOperationDataStub(input);
            {
                var actual = OperationData.CreateFromNative(broker);

                Assert.IsTrue(((ICollection <ArraySegment <byte> >)actual).IsReadOnly);
                validation(actual);
            }

            // run the test with the other public function
            {
                uint   count  = 0;
                IntPtr buffer = broker.GetData(out count);

                var actual = OperationData.CreateFromNative(count, buffer);

                Assert.IsTrue(((ICollection <ArraySegment <byte> >)actual).IsReadOnly);
                validation(actual);
            }
        }
Exemplo n.º 3
0
        public void OperationDataWrapper_EmptyOperationReturnsData()
        {
            var buffer = OperationData.CreateFromNative(0, IntPtr.Zero);

            Assert.AreEqual(0, buffer.Count);
        }