organizationForTest function

  1. @visibleForTesting
Organization organizationForTest({
  1. int id = 42,
  2. String name = 'Test Organization',
  3. OrganizationType organizationType = OrganizationType.personal,
  4. DateTime? createdAt,
  5. DateTime? updatedAt,
})

Constructs an Organization with arbitrary default values for testing.

Replaces the old Organization.forTest factory — since Organization is now generated from the OpenAPI spec, test-only defaults live here instead of on the generated class.

Implementation

@visibleForTesting
Organization organizationForTest({
  int id = 42,
  String name = 'Test Organization',
  OrganizationType organizationType = OrganizationType.personal,
  DateTime? createdAt,
  DateTime? updatedAt,
}) => Organization(
  id: id,
  name: name,
  organizationType: organizationType,
  createdAt: createdAt ?? DateTime.now(),
  updatedAt: updatedAt ?? DateTime.now(),
);