public void BrowseMessageConstructionTest()
 {
     ServiceMessageTestHelper.ActionShouldThrow <ArgumentException>(() => new BrowseMessage(new ServiceMessageHeader(OperationCode.RegisterServiceReply)));
     ServiceMessageTestHelper.ActionShouldThrow <ArgumentException>(() => new BrowseMessage(null, null, 0));
     ServiceMessageTestHelper.ActionShouldThrow <ArgumentException>(() => new BrowseMessage("", null, 0));
     ServiceMessageTestHelper.ActionShouldNotThrow(() => new BrowseMessage(Servicetype, null, 0));
 }
        public void RegisterMessageConstructionTest()
        {
            ServiceMessageTestHelper.ActionShouldThrow <ArgumentException>(() => new RegisterMessage(new ServiceMessageHeader(OperationCode.SendBpf)));
            ServiceMessageTestHelper.ActionShouldThrow <ArgumentException>(() => new RegisterMessage(InstanceName, null, Domain, HostName, 3456, _txtRecordBytes));
            ServiceMessageTestHelper.ActionShouldThrow <ArgumentException>(() => new RegisterMessage(InstanceName, string.Empty, Domain, HostName, 3456, _txtRecordBytes));

            ServiceMessageTestHelper.ActionShouldNotThrow(() => new RegisterMessage(InstanceName, Servicetype, Domain, HostName, 3456, _txtRecordBytes));
        }
Пример #3
0
 public void LookupMessageConstructionTest()
 {
     ServiceMessageTestHelper.ActionShouldThrow <ArgumentException>(() => new LookupMessage(new ServiceMessageHeader(OperationCode.BrowseRequest)));
     ServiceMessageTestHelper.ActionShouldThrow <ArgumentException>(() => new LookupMessage(null, ProtoFlags, false));
     ServiceMessageTestHelper.ActionShouldThrow <ArgumentException>(() => new LookupMessage(string.Empty, ProtoFlags, false));
     ServiceMessageTestHelper.ActionShouldThrow <ArgumentException>(() => new LookupMessage(HostName, ProtocolFlags.None, false));
     ServiceMessageTestHelper.ActionShouldNotThrow(() => new LookupMessage(HostName, ProtoFlags, false));
 }
Пример #4
0
        public void ResolveMessageConstructionTest()
        {
            ServiceMessageTestHelper.ActionShouldThrow <ArgumentException>(() => new ResolveMessage(new ServiceMessageHeader(OperationCode.SendBpf)));

            ServiceMessageTestHelper.ActionShouldThrow <ArgumentException>(() => new ResolveMessage(null, ServiceType, Domain, 0));
            ServiceMessageTestHelper.ActionShouldThrow <ArgumentException>(() => new ResolveMessage(string.Empty, ServiceType, Domain, 0));

            ServiceMessageTestHelper.ActionShouldThrow <ArgumentException>(() => new ResolveMessage(InstanceName, null, Domain, 0));
            ServiceMessageTestHelper.ActionShouldThrow <ArgumentException>(() => new ResolveMessage(InstanceName, string.Empty, Domain, 0));

            ServiceMessageTestHelper.ActionShouldThrow <ArgumentException>(() => new ResolveMessage(InstanceName, ServiceType, null, 0));
            ServiceMessageTestHelper.ActionShouldThrow <ArgumentException>(() => new ResolveMessage(InstanceName, ServiceType, string.Empty, 0));

            ServiceMessageTestHelper.ActionShouldNotThrow(() => new ResolveMessage(InstanceName, ServiceType, Domain, 0));
        }