public DHCPv4InformHandledEvent(Guid scopeId, DHCPv4Packet request, InformErros error) : this(scopeId, request, DHCPv4Packet.Empty, error) { if (error == InformErros.NoError) { throw new ArgumentException("if a request has no error, a response packet is needed"); } }
public DHCPv4InformHandledEvent(DHCPv4Packet request, DHCPv4Packet response, InformErros error) : base(request, response, error == InformErros.NoError) { if (error != InformErros.ScopeNotFound) { throw new ArgumentException("a scope id has to be specified if an error different from 'ScopeNotFound' is used"); } Error = error; }
private void CheckHandeledEvent( Int32 index, InformErros error, DHCPv4Packet requestPacket, DHCPv4Packet result, DHCPv4RootScope rootScope) { IEnumerable <DomainEvent> changes = rootScope.GetChanges(); Assert.IsAssignableFrom <DHCPv4InformHandledEvent>(changes.ElementAt(index)); DHCPv4InformHandledEvent handeledEvent = (DHCPv4InformHandledEvent)changes.ElementAt(index); Assert.Equal(requestPacket, handeledEvent.Request); Assert.Equal(result, handeledEvent.Response); Assert.Equal(error, handeledEvent.Error); if (error == InformErros.NoError) { Assert.True(handeledEvent.WasSuccessfullHandled); } else { Assert.False(handeledEvent.WasSuccessfullHandled); } }
public DHCPv4InformHandledEvent(Guid scopeId, DHCPv4Packet request, DHCPv4Packet response, InformErros error) : base(scopeId, request, response, error == InformErros.NoError) { Error = error; }
public DHCPv4InformHandledEvent(DHCPv4Packet request, InformErros error) : this(request, DHCPv4Packet.Empty, error) { }