public void CanAdd() { using (var data = new DbTestData()) { Guid userId = data.user1.ID; Guid translationId = data.translation1.ID; dal.ReadById(userId, translationId).Should().BeNull(); var newVote = dal.Add(new Vote(userId, translationId, true)); dal.ReadById(userId, translationId).Should().NotBeNull(); newVote.Should().NotBeNull(); newVote.UserID.Should().Be(userId); newVote.TranslationID.Should().Be(translationId); newVote.IsUpvote.Should().BeTrue(); dal.DeleteById(newVote.UserID, newVote.TranslationID); } }
public void DeleteById(Guid translationId, Guid authenticatedUserId) { _votesDAL.DeleteById(authenticatedUserId, translationId); }