Ejemplo n.º 1
0
		public void ReadAsByteArrayAsync ()
		{
			var ms = new MemoryStream ();
			ms.WriteByte (4);
			ms.WriteByte (55);

			var sc = new StreamContent (ms);
			var res = sc.ReadAsByteArrayAsync ().Result;
			Assert.AreEqual (0, res.Length, "#1");

			ms.Seek (0, SeekOrigin.Begin);
			sc = new StreamContent (ms);
			res = sc.ReadAsByteArrayAsync ().Result;
			Assert.AreEqual (2, res.Length, "#10");
			Assert.AreEqual (55, res[1], "#11");
		}