2019-08-30 12:34:51 +01:00
|
|
|
// Copyright (C) 2019 Storj Labs, Inc.
|
|
|
|
// See LICENSE for copying information.
|
|
|
|
|
2019-12-12 16:25:38 +00:00
|
|
|
import { CreateProjectModel, Project, ProjectLimits, ProjectsApi } from '@/types/projects';
|
2019-08-30 12:34:51 +01:00
|
|
|
|
|
|
|
/**
|
2019-09-27 15:41:04 +01:00
|
|
|
* Mock for ProjectsApi
|
2019-08-30 12:34:51 +01:00
|
|
|
*/
|
|
|
|
export class ProjectsApiMock implements ProjectsApi {
|
2019-09-27 15:41:04 +01:00
|
|
|
private mockProjects: Project[];
|
2019-12-12 16:25:38 +00:00
|
|
|
private mockLimits: ProjectLimits;
|
2019-08-30 12:34:51 +01:00
|
|
|
|
2019-09-27 15:41:04 +01:00
|
|
|
public setMockProjects(mockProjects: Project[]): void {
|
|
|
|
this.mockProjects = mockProjects;
|
2019-08-30 12:34:51 +01:00
|
|
|
}
|
|
|
|
|
2019-12-12 16:25:38 +00:00
|
|
|
public setMockLimits(mockLimits: ProjectLimits): void {
|
|
|
|
this.mockLimits = mockLimits;
|
|
|
|
}
|
|
|
|
|
2019-08-30 12:34:51 +01:00
|
|
|
create(createProjectModel: CreateProjectModel): Promise<Project> {
|
|
|
|
throw new Error('not implemented');
|
|
|
|
}
|
|
|
|
|
|
|
|
delete(projectId: string): Promise<void> {
|
|
|
|
throw new Error('not implemented');
|
|
|
|
}
|
|
|
|
|
|
|
|
get(): Promise<Project[]> {
|
2019-09-27 15:41:04 +01:00
|
|
|
return Promise.resolve(this.mockProjects);
|
2019-08-30 12:34:51 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
update(projectId: string, description: string): Promise<void> {
|
|
|
|
throw new Error('not implemented');
|
|
|
|
}
|
2019-12-12 16:25:38 +00:00
|
|
|
|
|
|
|
getLimits(projectId: string): Promise<ProjectLimits> {
|
|
|
|
throw Promise.resolve(this.mockLimits);
|
|
|
|
}
|
2019-08-30 12:34:51 +01:00
|
|
|
}
|