コード例 #1
0
            public DHCPv4DeclineHandledEvent(DHCPv4Packet request, DeclineErros error) : base(request, DHCPv4Packet.Empty, false)
            {
                if (error != DeclineErros.ScopeNotFound)
                {
                    throw new ArgumentException("a scope id has to be specified if an error different from 'ScopeNotFound' is used");
                }

                Error = error;
            }
コード例 #2
0
        private void CheckDeclinedEvent(
            Int32 index, DeclineErros error,
            DHCPv4Packet requestPacket,
            DHCPv4RootScope rootScope, Guid scopeId)
        {
            IEnumerable <DomainEvent> changes = rootScope.GetChanges();

            Assert.IsAssignableFrom <DHCPv4DeclineHandledEvent>(changes.ElementAt(index));

            DHCPv4DeclineHandledEvent handeledEvent = (DHCPv4DeclineHandledEvent)changes.ElementAt(index);

            Assert.Equal(requestPacket, handeledEvent.Request);
            Assert.Equal(DHCPv4Packet.Empty, handeledEvent.Response);
            Assert.Equal(scopeId, handeledEvent.ScopeId);
            Assert.Equal(error, handeledEvent.Error);
            if (error == DeclineErros.NoError)
            {
                Assert.True(handeledEvent.WasSuccessfullHandled);
            }
            else
            {
                Assert.False(handeledEvent.WasSuccessfullHandled);
            }
        }
コード例 #3
0
 public DHCPv4DeclineHandledEvent(Guid scopeId, DHCPv4Packet request, DeclineErros error) : base(scopeId, request, DHCPv4Packet.Empty, error == DeclineErros.NoError)
 {
     Error = error;
 }