Lines Matching refs:Assert
57 Assert.AreEqual(data, rawOutput.ToArray()); in AssertWriteVarint()
64 Assert.AreEqual(data, bufferWriter.WrittenSpan.ToArray()); in AssertWriteVarint()
67 … Assert.AreEqual(data.Length, CodedOutputStream.ComputeRawVarint32Size((uint) value)); in AssertWriteVarint()
76 Assert.AreEqual(data, rawOutput.ToArray()); in AssertWriteVarint()
83 Assert.AreEqual(data, bufferWriter.WrittenSpan.ToArray()); in AssertWriteVarint()
86 Assert.AreEqual(data.Length, CodedOutputStream.ComputeRawVarint64Size(value)); in AssertWriteVarint()
100 Assert.AreEqual(data, rawOutput.ToArray()); in AssertWriteVarint()
107 Assert.AreEqual(data, bufferWriter.WrittenSpan.ToArray()); in AssertWriteVarint()
115 Assert.AreEqual(data, rawOutput.ToArray()); in AssertWriteVarint()
122 Assert.AreEqual(data, bufferWriter.WrittenSpan.ToArray()); in AssertWriteVarint()
174 Assert.AreEqual(data, rawOutput.ToArray()); in AssertWriteLittleEndian32()
180 Assert.AreEqual(data, bufferWriter.WrittenSpan.ToArray()); in AssertWriteLittleEndian32()
190 Assert.AreEqual(data, rawOutput.ToArray()); in AssertWriteLittleEndian32()
197 Assert.AreEqual(data, bufferWriter.WrittenSpan.ToArray()); in AssertWriteLittleEndian32()
212 Assert.AreEqual(data, rawOutput.ToArray()); in AssertWriteLittleEndian64()
218 Assert.AreEqual(data, bufferWriter.WrittenSpan.ToArray()); in AssertWriteLittleEndian64()
228 Assert.AreEqual(data, rawOutput.ToArray()); in AssertWriteLittleEndian64()
235 Assert.AreEqual(data, bufferWriter.WrittenSpan.ToArray()); in AssertWriteLittleEndian64()
270 Assert.AreEqual(rawBytes, rawOutput.ToArray()); in WriteWholeMessage_VaryingBlockSizes()
275 Assert.AreEqual(rawBytes, bufferWriter.WrittenSpan.ToArray()); in WriteWholeMessage_VaryingBlockSizes()
298 Assert.AreEqual(expectedBytes1, bufferWriter.WrittenSpan.ToArray()); in WriteContext_WritesWithFlushes()
302 Assert.AreEqual(expectedBytes2, bufferWriter.WrittenSpan.ToArray()); in WriteContext_WritesWithFlushes()
308 Assert.AreEqual(0u, WritingPrimitives.EncodeZigZag32(0)); in EncodeZigZag32()
309 Assert.AreEqual(1u, WritingPrimitives.EncodeZigZag32(-1)); in EncodeZigZag32()
310 Assert.AreEqual(2u, WritingPrimitives.EncodeZigZag32(1)); in EncodeZigZag32()
311 Assert.AreEqual(3u, WritingPrimitives.EncodeZigZag32(-2)); in EncodeZigZag32()
312 Assert.AreEqual(0x7FFFFFFEu, WritingPrimitives.EncodeZigZag32(0x3FFFFFFF)); in EncodeZigZag32()
313 … Assert.AreEqual(0x7FFFFFFFu, WritingPrimitives.EncodeZigZag32(unchecked((int) 0xC0000000))); in EncodeZigZag32()
314 Assert.AreEqual(0xFFFFFFFEu, WritingPrimitives.EncodeZigZag32(0x7FFFFFFF)); in EncodeZigZag32()
315 … Assert.AreEqual(0xFFFFFFFFu, WritingPrimitives.EncodeZigZag32(unchecked((int) 0x80000000))); in EncodeZigZag32()
321 Assert.AreEqual(0u, WritingPrimitives.EncodeZigZag64(0)); in EncodeZigZag64()
322 Assert.AreEqual(1u, WritingPrimitives.EncodeZigZag64(-1)); in EncodeZigZag64()
323 Assert.AreEqual(2u, WritingPrimitives.EncodeZigZag64(1)); in EncodeZigZag64()
324 Assert.AreEqual(3u, WritingPrimitives.EncodeZigZag64(-2)); in EncodeZigZag64()
325 Assert.AreEqual(0x000000007FFFFFFEuL, in EncodeZigZag64()
327 Assert.AreEqual(0x000000007FFFFFFFuL, in EncodeZigZag64()
329 Assert.AreEqual(0x00000000FFFFFFFEuL, in EncodeZigZag64()
331 Assert.AreEqual(0x00000000FFFFFFFFuL, in EncodeZigZag64()
333 Assert.AreEqual(0xFFFFFFFFFFFFFFFEL, in EncodeZigZag64()
335 Assert.AreEqual(0xFFFFFFFFFFFFFFFFL, in EncodeZigZag64()
344 … Assert.AreEqual(0, ParsingPrimitives.DecodeZigZag32(WritingPrimitives.EncodeZigZag32(0))); in RoundTripZigZag32()
345 … Assert.AreEqual(1, ParsingPrimitives.DecodeZigZag32(WritingPrimitives.EncodeZigZag32(1))); in RoundTripZigZag32()
346 … Assert.AreEqual(-1, ParsingPrimitives.DecodeZigZag32(WritingPrimitives.EncodeZigZag32(-1))); in RoundTripZigZag32()
347 … Assert.AreEqual(14927, ParsingPrimitives.DecodeZigZag32(WritingPrimitives.EncodeZigZag32(14927))); in RoundTripZigZag32()
348 … Assert.AreEqual(-3612, ParsingPrimitives.DecodeZigZag32(WritingPrimitives.EncodeZigZag32(-3612))); in RoundTripZigZag32()
354 … Assert.AreEqual(0, ParsingPrimitives.DecodeZigZag64(WritingPrimitives.EncodeZigZag64(0))); in RoundTripZigZag64()
355 … Assert.AreEqual(1, ParsingPrimitives.DecodeZigZag64(WritingPrimitives.EncodeZigZag64(1))); in RoundTripZigZag64()
356 … Assert.AreEqual(-1, ParsingPrimitives.DecodeZigZag64(WritingPrimitives.EncodeZigZag64(-1))); in RoundTripZigZag64()
357 … Assert.AreEqual(14927, ParsingPrimitives.DecodeZigZag64(WritingPrimitives.EncodeZigZag64(14927))); in RoundTripZigZag64()
358 … Assert.AreEqual(-3612, ParsingPrimitives.DecodeZigZag64(WritingPrimitives.EncodeZigZag64(-3612))); in RoundTripZigZag64()
360 Assert.AreEqual(856912304801416L, in RoundTripZigZag64()
362 Assert.AreEqual(-75123905439571256L, in RoundTripZigZag64()
369 Assert.AreEqual(10, CodedOutputStream.ComputeInt32Size(-2)); in TestNegativeEnumNoTag()
370 Assert.AreEqual(10, CodedOutputStream.ComputeEnumSize((int) SampleEnum.NegativeValue)); in TestNegativeEnumNoTag()
376 Assert.AreEqual(0, output.SpaceLeft); in TestNegativeEnumNoTag()
377 Assert.AreEqual("FE-FF-FF-FF-FF-FF-FF-FF-FF-01", BitConverter.ToString(bytes)); in TestNegativeEnumNoTag()
393 Assert.AreEqual(1, cout.Position); in TestCodedInputOutputPosition()
395 Assert.AreEqual(3, cout.Position); in TestCodedInputOutputPosition()
398 Assert.AreEqual(4, cout.Position); in TestCodedInputOutputPosition()
400 Assert.AreEqual(115, cout.Position); in TestCodedInputOutputPosition()
403 Assert.AreEqual(116, cout.Position); in TestCodedInputOutputPosition()
405 Assert.AreEqual(120, cout.Position); in TestCodedInputOutputPosition()
414 Assert.AreEqual(1, cout.Position); in TestCodedInputOutputPosition()
416 Assert.AreEqual(3, cout.Position); in TestCodedInputOutputPosition()
419 Assert.AreEqual(4, cout.Position); in TestCodedInputOutputPosition()
421 Assert.AreEqual(125, cout.Position); in TestCodedInputOutputPosition()
424 Assert.AreEqual(126, cout.Position); in TestCodedInputOutputPosition()
426 Assert.AreEqual(130, cout.Position); in TestCodedInputOutputPosition()
432 Assert.AreEqual(0, cin.Position); in TestCodedInputOutputPosition()
435 Assert.AreEqual(1, tag >> 3); in TestCodedInputOutputPosition()
436 Assert.AreEqual(1, cin.Position); in TestCodedInputOutputPosition()
437 Assert.AreEqual(500, cin.ReadInt32()); in TestCodedInputOutputPosition()
438 Assert.AreEqual(3, cin.Position); in TestCodedInputOutputPosition()
441 Assert.AreEqual(2, tag >> 3); in TestCodedInputOutputPosition()
442 Assert.AreEqual(4, cin.Position); in TestCodedInputOutputPosition()
444 Assert.AreEqual(120, childlen); in TestCodedInputOutputPosition()
445 Assert.AreEqual(5, cin.Position); in TestCodedInputOutputPosition()
447 Assert.AreEqual(5, cin.Position); in TestCodedInputOutputPosition()
452 Assert.AreEqual(11, tag >> 3); in TestCodedInputOutputPosition()
453 Assert.AreEqual(6, cin.Position); in TestCodedInputOutputPosition()
454 Assert.AreEqual(500, cin.ReadInt32()); in TestCodedInputOutputPosition()
455 Assert.AreEqual(8, cin.Position); in TestCodedInputOutputPosition()
458 Assert.AreEqual(12, tag >> 3); in TestCodedInputOutputPosition()
459 Assert.AreEqual(9, cin.Position); in TestCodedInputOutputPosition()
461 Assert.AreEqual(110, bstr.Length); in TestCodedInputOutputPosition()
462 Assert.AreEqual((byte) 109, bstr[109]); in TestCodedInputOutputPosition()
463 Assert.AreEqual(120, cin.Position); in TestCodedInputOutputPosition()
466 Assert.AreEqual(13, tag >> 3); in TestCodedInputOutputPosition()
468 Assert.AreEqual(121, cin.Position); in TestCodedInputOutputPosition()
469 Assert.AreEqual(501, cin.ReadSFixed32()); in TestCodedInputOutputPosition()
470 Assert.AreEqual(125, cin.Position); in TestCodedInputOutputPosition()
471 Assert.IsTrue(cin.IsAtEnd); in TestCodedInputOutputPosition()
474 Assert.AreEqual(125, cin.Position); in TestCodedInputOutputPosition()
477 Assert.AreEqual(3, tag >> 3); in TestCodedInputOutputPosition()
478 Assert.AreEqual(126, cin.Position); in TestCodedInputOutputPosition()
479 Assert.AreEqual(501, cin.ReadSFixed32()); in TestCodedInputOutputPosition()
480 Assert.AreEqual(130, cin.Position); in TestCodedInputOutputPosition()
481 Assert.IsTrue(cin.IsAtEnd); in TestCodedInputOutputPosition()
489 Assert.IsTrue(memoryStream.CanWrite); in Dispose_DisposesUnderlyingStream()
493 Assert.AreEqual(0, memoryStream.Position); // Not flushed yet in Dispose_DisposesUnderlyingStream()
495 …Assert.AreEqual(1, memoryStream.ToArray().Length); // Flushed data from CodedOutputStream to Memor… in Dispose_DisposesUnderlyingStream()
496 Assert.IsFalse(memoryStream.CanWrite); // Disposed in Dispose_DisposesUnderlyingStream()
503 Assert.IsTrue(memoryStream.CanWrite); in Dispose_WithLeaveOpen()
507 Assert.AreEqual(0, memoryStream.Position); // Not flushed yet in Dispose_WithLeaveOpen()
509 … Assert.AreEqual(1, memoryStream.Position); // Flushed data from CodedOutputStream to MemoryStream in Dispose_WithLeaveOpen()
510 Assert.IsTrue(memoryStream.CanWrite); // We left the stream open in Dispose_WithLeaveOpen()