-
Notifications
You must be signed in to change notification settings - Fork 67
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implemented a resource tester to make the resource development easier…
… and more stable
- Loading branch information
1 parent
6c2b0be
commit 36414fc
Showing
3 changed files
with
1,157 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
import { IResource } from '../resource/IResource'; | ||
export interface ResourceTesterOptions { | ||
canHaveVirtualFolderChildren: boolean; | ||
canHaveVirtualFileChildren: boolean; | ||
canGetLastModifiedDate: boolean; | ||
canGetCreationDate: boolean; | ||
canRemoveChildren: boolean; | ||
canHaveChildren: boolean; | ||
canGetMimeType: boolean; | ||
canGetChildren: boolean; | ||
canBeCreated: boolean; | ||
canBeDeleted: boolean; | ||
canBeRenamed: boolean; | ||
canGetSize: boolean; | ||
canBeMoved: boolean; | ||
canWrite: boolean; | ||
canRead: boolean; | ||
} | ||
export declare type ResourceTesterTestCallback = (error: Error, isValid: boolean, text: string, optionReverse?: boolean, cbNext?: () => void) => void; | ||
export declare type ResourceTesterProducerCallback<T> = (resource: T) => void; | ||
export declare type ResourceTesterProducer<T> = (willCreate: boolean, callback: ResourceTesterProducerCallback<T>) => void; | ||
export declare class ResourceTester<T extends IResource> { | ||
options: ResourceTesterOptions; | ||
producer: ResourceTesterProducer<T>; | ||
protected static uuid: number; | ||
constructor(options: ResourceTesterOptions, producer: ResourceTesterProducer<T>); | ||
protected multiple(callback: ResourceTesterTestCallback, nb: number): ResourceTesterTestCallback; | ||
run(callback: (results: any) => void): void; | ||
protected create(callback: ResourceTesterTestCallback): void; | ||
protected delete(callback: ResourceTesterTestCallback): void; | ||
protected moveTo(callback: ResourceTesterTestCallback): void; | ||
protected rename(callback: ResourceTesterTestCallback): void; | ||
protected writeRead(callback: ResourceTesterTestCallback): void; | ||
protected mimeType(callback: ResourceTesterTestCallback): void; | ||
protected size(callback: ResourceTesterTestCallback): void; | ||
protected addChild(callback: ResourceTesterTestCallback): void; | ||
protected removeChild(callback: ResourceTesterTestCallback): void; | ||
protected getChildren(callback: ResourceTesterTestCallback): void; | ||
protected setProperty(callback: ResourceTesterTestCallback): void; | ||
protected removeProperty(callback: ResourceTesterTestCallback): void; | ||
protected getProperties(callback: ResourceTesterTestCallback): void; | ||
protected creationDate(callback: ResourceTesterTestCallback): void; | ||
protected lastModifiedDate(callback: ResourceTesterTestCallback): void; | ||
protected webName(callback: ResourceTesterTestCallback): void; | ||
protected type(callback: ResourceTesterTestCallback): void; | ||
} |
Oops, something went wrong.