private void ErrorIsSet()
 {
     var error = new Error("id");
     var ex = new UnauthorizedException(error);
     Assert.Equal(Defaults.UnauthorizedException.Message, ex.Message);
     Assert.Same(error, ex.Error);
 }
 private void MessageIsSet()
 {
     var ex = new UnauthorizedException("access denied");
     Assert.Equal("access denied", ex.Message);
     Assert.NotNull(ex.Error);
     Assert.Equal(1, ex.Error.Messages.Count());
     Assert.Equal("access denied", ex.Error.Messages.First().Message);
 }
 private void PropertiesAreDefaulted()
 {
     var ex = new UnauthorizedException();
     Assert.Equal(Defaults.UnauthorizedException.Message, ex.Message);
     Assert.NotNull(ex.Error);
     Assert.Equal(1, ex.Error.Messages.Count());
     Assert.Equal(Defaults.UnauthorizedException.Message, ex.Error.Messages.First().Message);
 }