// POST /api/VotableFeatures/ public void Post(FeatureVote featureVote) { try { votableFeatureVoter.CastVote(featureVote.VotableFeatureId, featureVote.VoteUp); } catch (EntityDoesNotExistException) { throw new HttpResponseException(HttpStatusCode.NotFound); } }
public void Post_CastsAVoteForTheGivenFeature() { FeatureVote featureVote = new FeatureVote { VotableFeatureId = "some feature id", VoteUp = true }; autoMocker.ClassUnderTest.Post(featureVote); autoMocker.Get<IVotableFeatureVoter>().AssertWasCalled( mock => mock.CastVote( Arg<String>.Is.Equal(featureVote.VotableFeatureId), Arg<bool>.Is.Equal(featureVote.VoteUp))); }