public void BuildSingleChunk() { // Arrange var maxChunkSize = 100; var tokenValue = "<xml>small<xml>"; var paramToken = new ParamValue(ParamValue.Param.token, tokenValue); var chunkBuilder = new ChunkBuilder(maxChunkSize); // Act var remaining = chunkBuilder.Append(paramToken); var actual = chunkBuilder.GetValue(); // Assert Assert.IsNull(remaining); Assert.AreEqual($"{ParamValue.Param.token}=\"{tokenValue}\"", actual); }
public void ExceedChunkSize() { // Arrange var tokenValue = "123456"; var maxChunkSize = 10; var paramToken = new ParamValue(ParamValue.Param.token, tokenValue); var chunkBuilder = new ChunkBuilder(maxChunkSize); // Act var remaining = chunkBuilder.Append(paramToken); var actual = chunkBuilder.GetValue(); // Assert Assert.AreEqual($"{ParamValue.Param.token}=\"12\"", actual); Assert.NotNull(remaining); Assert.AreEqual(ParamValue.Param.token, remaining.Key); Assert.AreEqual("3456", remaining.Value); }