diff --git a/squarenotsquare/__mock__/mockRealmObject.js b/squarenotsquare/__mock__/mockRealmObject.js index 294f642..481e814 100644 --- a/squarenotsquare/__mock__/mockRealmObject.js +++ b/squarenotsquare/__mock__/mockRealmObject.js @@ -6,16 +6,27 @@ export class MockRealm{ constructor(schemaVersion){ this.schemaVersion = schemaVersion; - this.SystemRepo = System.name; - this.ScoreRepo = Score.name; - this.UserRepo = User.name; - - this[this.SystemRepo] = []; - this[this.ScoreRepo] = []; - this[this.UserRepo] = []; + this[System.name] = []; + this[Score.name] = []; + this[User.name] = []; + this.deletedKeys = []; } create(repoName, entity){ this[repoName].push(entity); } + + objects(repoName){ + let objects = this[repoName]; + objects.filtered = this.filtered ? this.filtered.bind(this, repoName) : () => objects; + return objects; + } + + write(callback){ + callback(); + } + + delete(key){ + this.deletedKeys.push(key); + } } \ No newline at end of file