Files
privacy.sexy/tests/unit/shared/Stubs/CategoryCollectionParserStub.ts
undergroundwires a54e16488c Change slogan and refactor project info naming
The project's slagon has been updated back to "Privacy is sexy" from
"Now you have the choice" for enhanced brand clarity and memorability.

This change also reflects the community's preference and aligns with the
project's established identity.

This commit also refactors naming and structure of project information
(metadata) struct to enhance clarity and maintainability in relation to
changing the slogan.

Key changes include:

- Update UI components to display the revised slogan.
- Remove period from project slogan in code area for consistency with a
  explanatory comment for future maintainability.
- Refactor header container and class names for clarity.
- Standardize project metadata usage in `TheCodeArea.vue` to ensure
  consistency.
- Improve code clarity by renaming `IProjectInformation` to
  `ProjectDetails` and `ProjectInformation` to `GitHubProjectDetails`.
- Organize `ProjectDetails` under a dedicated `Project` directory within
  the domain layer for better structure.

These changes are expected to improve the project's appeal and
streamline future maintenance and development efforts.
2024-02-10 18:50:56 +01:00

41 lines
1.5 KiB
TypeScript

import type { ProjectDetails } from '@/domain/Project/ProjectDetails';
import { ICategoryCollection } from '@/domain/ICategoryCollection';
import { getEnumValues } from '@/application/Common/Enum';
import type { CollectionData } from '@/application/collections/';
import { CategoryCollectionParserType } from '@/application/Parser/ApplicationParser';
import { OperatingSystem } from '@/domain/OperatingSystem';
import { CategoryCollectionStub } from './CategoryCollectionStub';
export class CategoryCollectionParserStub {
public readonly arguments = new Array<{
data: CollectionData,
projectDetails: ProjectDetails,
}>();
private readonly returnValues = new Map<CollectionData, ICategoryCollection>();
public withReturnValue(
data: CollectionData,
collection: ICategoryCollection,
): this {
this.returnValues.set(data, collection);
return this;
}
public getStub(): CategoryCollectionParserType {
return (data: CollectionData, projectDetails: ProjectDetails): ICategoryCollection => {
this.arguments.push({ data, projectDetails });
const foundReturnValue = this.returnValues.get(data);
if (foundReturnValue) {
return foundReturnValue;
}
// Get next OS with a unique OS so mock does not result in an invalid app due to duplicated OS
// collections.
const currentRun = this.arguments.length - 1;
const nextOs = getEnumValues(OperatingSystem)[currentRun];
return new CategoryCollectionStub()
.withOs(nextOs);
};
}
}