public void SendBuf2Test(int start, int? pos) { var bodyBuf = new BodyBuf(DmyMax * 3); for (int i = 0; i < 10; i++) { bodyBuf.Add(_dmyData);//バッファを超えて保存 } var b = bodyBuf.SendBuf(start); Assert.AreEqual(b[(int)pos], (byte)pos); }
public void SendBufTest(int count) { var bodyBuf = new BodyBuf(6400); for (var i = 0; i < count; i++) { bodyBuf.Add(_dmyData); var b = bodyBuf.SendBuf(i * DmyMax); Assert.AreEqual(b[10], 10); } }
public void LengthTest(int count, int max) { var bodyBuf = new BodyBuf(max); for(var i=0;i<count;i++){ bodyBuf.Add(_dmyData); bodyBuf.SendBuf(i * DmyMax); } Assert.AreEqual(bodyBuf.Length, count * DmyMax); }
public void SendBuf0Test(int count, int? pos) { var bodyBuf = new BodyBuf(DmyMax*100); for (var i = 0; i < 100; i++) { bodyBuf.Add(_dmyData); } var b = bodyBuf.SendBuf(count*DmyMax); if (pos == null) { Assert.IsNull(b); } else { Assert.AreEqual(b[(int)pos], (byte)pos); } }