import 'package:afterwork/core/errors/failures.dart';
import 'package:flutter_test/flutter_test.dart';

void main() {
  group('Failures', () {
    test('ServerFailure should have correct props', () {
      // Arrange
      final failure = ServerFailure();

      // Assert
      // ServerFailure a message, code (de Failure) et statusCode
      expect(failure.props.length, 3);
      expect(failure.props[0], 'Erreur serveur'); // message
      expect(failure.props[1], isNull); // code
      expect(failure.props[2], isNull); // statusCode
    });

    test('CacheFailure should have correct props', () {
      // Arrange
      final failure = CacheFailure();

      // Assert
      // CacheFailure a message et code (de Failure)
      expect(failure.props.length, 2);
      expect(failure.props[0], 'Erreur de cache'); // message
      expect(failure.props[1], isNull); // code
    });
  });
}

