import { PropertyNullOrUndefinedError } from './property-is-null-or-undefined.error';

describe('PropertyNullOrUndefinedError', () => {
  it('should create an error instance with the correct code and message', () => {
    // Arrange
    const propertyName = 'userId';

    // Act
    const error = new PropertyNullOrUndefinedError(propertyName);

    // Assert
    expect(error).toBeInstanceOf(PropertyNullOrUndefinedError);
    expect(error.code).toBe('PROPERTY_NULL_OR_UNDEFINED');
    expect(error.message).toBe(
      `Property "${propertyName}" is null or undefined.`,
    );
  });
});
