DataCollectorTests CollectTonsOfDataInTwoChunks Method Delta Engine Documentation

Namespace: DeltaEngine.Networking.Tests.Tcp
Assembly: DeltaEngine.Networking.Tests (in DeltaEngine.Networking.Tests.dll) Version: 1.1.1.0 (1.1.1)
Syntax

public void CollectTonsOfDataInTwoChunks()
Examples

[Test]
public void CollectTonsOfDataInTwoChunks()
{
    var dataCollector = new DataCollector();
    dataCollector.ObjectFinished += container => collectedDataObjects.Add(container);
    Assert.IsEmpty(collectedDataObjects);
    var hugeByteArray = GetTestBytesWithLengthHeader(9348);
    dataCollector.ReadBytes(hugeByteArray, 0, 3);
    dataCollector.ReadBytes(hugeByteArray, 3, hugeByteArray.Length - 3);
    Assert.AreEqual(1, collectedDataObjects.Count);
}
See Also