/// <summary>
            /// Runs the test action of this test after setting up the batch reader stream.
            /// </summary>
            /// <param name="streamWrapper">The batch reader stream to test.</param>
            protected override void RunTestAction(BatchReaderStreamWrapper streamWrapper)
            {
                // Set a batch encoding since we assert that it is set before callign ProcessPartHeader
                streamWrapper.SetBatchEncoding(this.Encoding);

                bool isChangeSetPart = streamWrapper.ProcessPartHeader();

                this.VerifyResult(streamWrapper, isChangeSetPart);
            }
            /// <summary>
            /// Runs the actual test action against the batch reader stream.
            /// </summary>
            /// <param name="streamWrapper">The batch reader stream wrapper to execute the test action against.</param>
            protected override void RunTestAction(BatchReaderStreamWrapper streamWrapper)
            {
                this.Assert.IsTrue(this.ReadIterationCount > 0, "Must read at least once.");

                // Set a batch encoding since we assert that it is set before callign ProcessPartHeader
                streamWrapper.SetBatchEncoding(this.Encoding);

                string line = null;

                for (int i = 0; i < this.ReadIterationCount; ++i)
                {
                    line = streamWrapper.ReadLine();
                }

                this.VerifyResult(streamWrapper, line);
            }
Ejemplo n.º 3
0
            /// <summary>
            /// Runs the actual test action against the batch reader stream.
            /// </summary>
            /// <param name="streamWrapper">The batch reader stream wrapper to execute the test action against.</param>
            protected override void RunTestAction(BatchReaderStreamWrapper streamWrapper)
            {
                this.Assert.IsNotNull(this.ReadDescriptors, "Must have non-null read descriptors.");

                // Set a batch encoding since we assert that it is set before callign ProcessPartHeader
                streamWrapper.SetBatchEncoding(this.Encoding);

                foreach (BatchReaderStreamReadDescriptor readDescriptor in this.ReadDescriptors)
                {
                    byte[] buffer          = new byte[readDescriptor.BufferSize];
                    int    actualBytesRead = streamWrapper.ReadWithDelimiter(buffer, readDescriptor.BufferOffset, readDescriptor.NumberOfBytesToRead);
                    base.VerifyResult(readDescriptor, buffer, actualBytesRead);
                }

                base.VerifyResult(streamWrapper.BatchBuffer);
            }
            /// <summary>
            /// Runs the test action of this test after setting up the batch reader stream.
            /// </summary>
            /// <param name="streamWrapper">The batch reader stream to test.</param>
            protected override void RunTestAction(BatchReaderStreamWrapper streamWrapper)
            {
                // Set a batch encoding since we assert that it is set before callign ProcessPartHeader
                streamWrapper.SetBatchEncoding(this.Encoding);

                bool isChangeSetPart = streamWrapper.ProcessPartHeader();
                this.VerifyResult(streamWrapper, isChangeSetPart);
            }
            /// <summary>
            /// Runs the actual test action against the batch reader stream.
            /// </summary>
            /// <param name="streamWrapper">The batch reader stream wrapper to execute the test action against.</param>
            protected override void RunTestAction(BatchReaderStreamWrapper streamWrapper)
            {
                this.Assert.IsTrue(this.ReadIterationCount > 0, "Must read at least once.");

                // Set a batch encoding since we assert that it is set before callign ProcessPartHeader
                streamWrapper.SetBatchEncoding(this.Encoding);

                string line = null;
                for (int i = 0; i < this.ReadIterationCount; ++i)
                {
                    line = streamWrapper.ReadLine();
                }

                this.VerifyResult(streamWrapper, line);
            }
            /// <summary>
            /// Runs the actual test action against the batch reader stream.
            /// </summary>
            /// <param name="streamWrapper">The batch reader stream wrapper to execute the test action against.</param>
            protected override void RunTestAction(BatchReaderStreamWrapper streamWrapper)
            {
                this.Assert.IsNotNull(this.ReadDescriptors, "Must have non-null read descriptors.");

                // Set a batch encoding since we assert that it is set before callign ProcessPartHeader
                streamWrapper.SetBatchEncoding(this.Encoding);

                foreach (BatchReaderStreamReadDescriptor readDescriptor in this.ReadDescriptors)
                {
                    byte[] buffer = new byte[readDescriptor.BufferSize];
                    int actualBytesRead = streamWrapper.ReadWithLength(buffer, readDescriptor.BufferOffset, readDescriptor.NumberOfBytesToRead);
                    this.VerifyResult(readDescriptor, buffer, actualBytesRead);
                }

                base.VerifyResult(streamWrapper.BatchBuffer);
            }