public static void TestClientRequestMsg_GetHeaderSummary_TypeSTORED_ASSET_IDS_GET_ContainsSTORED_ASSET_IDS_GET() { var msg = new ClientRequestMsg(); var data = new byte[REQUEST_TYPE_LOC + 1]; data[REQUEST_TYPE_LOC] = (byte)RequestType.STORED_ASSET_IDS_GET; msg.AddRange(data); Assert.That(msg.GetHeaderSummary(), Contains.Substring("STORED_ASSET_IDS_GET")); }
public static void TestClientRequestMsg_GetHeaderSummary_TypeTEST_DoesntThrow() { var msg = new ClientRequestMsg(); var data = new byte[REQUEST_TYPE_LOC + 1]; data[REQUEST_TYPE_LOC] = (byte)RequestType.TEST; msg.AddRange(data); Assert.DoesNotThrow(() => msg.GetHeaderSummary()); }
public static void TestClientRequestMsg_GetHeaderSummary_TypeAndUUID_DoesntThrow() { var msg = new ClientRequestMsg(); var data = new byte[REQUEST_TYPE_LOC + UUID_TAG_LOCATION + UUID_LEN]; data[REQUEST_TYPE_LOC] = (byte)RequestType.TEST; Buffer.BlockCopy(Encoding.ASCII.GetBytes(Guid.NewGuid().ToString("N")), 0, data, UUID_TAG_LOCATION, UUID_LEN); msg.AddRange(data); Assert.DoesNotThrow(() => msg.GetHeaderSummary()); }
public static void TestClientRequestMsg_GetHeaderSummary_TypeAndUUID_ContainsUUID() { var msg = new ClientRequestMsg(); var assetId = Guid.NewGuid(); var data = new byte[REQUEST_TYPE_LOC + UUID_TAG_LOCATION + UUID_LEN]; data[REQUEST_TYPE_LOC] = (byte)RequestType.TEST; Buffer.BlockCopy(Encoding.ASCII.GetBytes(assetId.ToString("N")), 0, data, UUID_TAG_LOCATION, UUID_LEN); msg.AddRange(data); Assert.That(msg.GetHeaderSummary(), Contains.Substring(assetId.ToString("D"))); }
public static void TestClientRequestMsg_GetHeaderSummary_TypeAndUUIDAndDataLength123_Contains123() { var msg = new ClientRequestMsg(); var data = new byte[HEADER_SIZE + 123]; data[REQUEST_TYPE_LOC] = (byte)RequestType.TEST; Buffer.BlockCopy(Encoding.ASCII.GetBytes(Guid.NewGuid().ToString("N")), 0, data, UUID_TAG_LOCATION, UUID_LEN); data[DATA_SIZE_MARKER_LOC] = 0; data[DATA_SIZE_MARKER_LOC + 1] = 0; data[DATA_SIZE_MARKER_LOC + 2] = 0; data[DATA_SIZE_MARKER_LOC + 3] = 123; msg.AddRange(data); Assert.That(msg.GetHeaderSummary(), Contains.Substring("123")); }