public void BrowseCallbackMessageSerializationTest() { const string servicetype = "_cac.tcp"; const string domain = "local."; const string instanceName = "RPI.local"; var sm = new BrowseCallbackMessage(CallbackMessageTestHelper.BaseValues, instanceName, servicetype, domain); var bm = CallbackMessageTestHelper.SerializeDeserializeTest(sm); bm.Payload.InstanceName.Should().Be(instanceName); bm.Payload.ServiceType.Should().Be(servicetype); bm.Payload.Domain.Should().Be(domain); }
public void ResolveCallbackMessageSerializationTest() { const string hostName = "RPI.local"; const string fullName = ""; const ushort port = 4567; const string txtRecordString = "mac=12:34:56:78:AA:BB"; var txtRecord = TxtRecordBuilder.ParseString(txtRecordString); var txtRecordBytes = txtRecord.GetBytes(); var sm = new ResolveCallbackMessage(CallbackMessageTestHelper.BaseValues, hostName, fullName, port, txtRecordBytes); var dm = CallbackMessageTestHelper.SerializeDeserializeTest(sm); dm.Payload.HostName.Should().Be(hostName); dm.Payload.FullName.Should().Be(fullName); dm.Payload.Port.Should().Be(port); dm.Payload.TxtRecord.Should().BeEquivalentTo(txtRecordBytes); }
public void LookupCallbackMessageSerializationTest() { const string hostName = "RPI.local"; const ResourceRecordType rrType = ResourceRecordType.A; const ushort rrClass = 1; // IN var rrData = IPAddress.Parse("127.0.0.1").GetAddressBytes(); const uint ttl = 15; var sm = new LookupCallbackMessage(CallbackMessageTestHelper.BaseValues, hostName, rrType, rrClass, rrData, ttl); var dm = CallbackMessageTestHelper.SerializeDeserializeTest(sm); dm.Payload.HostName.Should().Be(hostName); dm.Payload.RecordType.Should().Be(rrType); dm.Payload.RecordClass.Should().Be(rrClass); dm.Payload.RecordData.Should().BeEquivalentTo(rrData); dm.Payload.TimeToLive.Should().Be(ttl); }