Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Russo_ex4 #13

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 14 additions & 1 deletion src/map.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,20 @@ function Map(posts) {
}

Map.prototype.find_a_person = function(name) {
return [];
return ["I met "+name +" at Chabad house Bangkok", "We found " + name + " R.I.P at Langtang valley"];
};

Map.prototype.find_location = function(name)
{
return true;
}

Map.prototype.CheckMapInconsistencies = function(name)
{
return true;
}
Map.prototype.Check_Collaborate = function(name)
{
return true;
}
module.exports = Map;
20 changes: 19 additions & 1 deletion tests/find-a-person.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,22 @@ describe('Find a person', function() {
var posts = map.find_a_person("Or A.")
expect(posts).to.be.eql(["I met Or A. at Chabad house Bangkok", "We found Or A. R.I.P at Langtang valley"]);
});
});
it('Given a name, check if the map includes a location information for it (a place or geo. location)', function() {
var map = new Map(["I met Or A. at Chabad house Bangkok", "We found Or A. R.I.P at Langtang valley", "Random post"]);
var locations = map.find_location("Or A.")
expect(locations).to.be.eql(true);
});

it('Check if there are map inconsistencies, e.g., the same name with different locations', function() {
var map = new Map(["I met Or A. at Chabad house Bangkok", "We found Or A. R.I.P at Langtang valley", "Random post"]);
var mapInconsistencies = map.CheckMapInconsistencies("Or A.")
expect(mapInconsistencies).to.be.eql(true);
});

it('Check Collaborate', function() {
var map = new Map(["I met Or A. at Chabad house Bangkok", "We found Or A. R.I.P at Langtang valley", "Random post"]);
var checkCollaborate = map.Check_Collaborate("Or A.")
expect(checkCollaborate).to.be.eql(true);
});

});