Ejemplo n.º 1
0
        public void Constructor_WithErrorCode()
        {
            var exception = new HttpUrlReservationAlreadyExistsException(5);

            exception.NativeErrorCode.Should().Be(5);
            exception.Message.Should().Be("Accès refusé");
        }
Ejemplo n.º 2
0
        public void Constructor_WithWin32ErrorCodeAndMessage()
        {
            var exception = new HttpUrlReservationAlreadyExistsException((Win32Error)5, "The message");

            exception.NativeErrorCode.Should().Be(5);
            exception.Message.Should().Be("The message");
        }
Ejemplo n.º 3
0
        public void Constructor_WithMessage()
        {
            var lastErrorCode = Marshal.GetLastWin32Error();
            var exception     = new HttpUrlReservationAlreadyExistsException("The message");

            exception.NativeErrorCode.Should().Be(lastErrorCode);
            exception.Message.Should().Be("The message");
        }
Ejemplo n.º 4
0
        public void Serialization()
        {
            var exception = new HttpUrlReservationAlreadyExistsException((Win32Error)5, "The message");

            exception.Should().BeBinarySerializable();
        }