public void CanReadByUserId() { using (var data = new DbTestData()) { var userId = data.user1.ID; var votes = dal.ReadAllByUserId(userId); votes.Should().NotBeNullOrEmpty(); votes.Should().HaveCount(1); } }
public void CanDelete() { using (var data = new DbTestData()) { var projectsDAL = new ProjectsDAL(DbTestData.ConnectionString); var translationsDAL = new TranslationsDAL(DbTestData.ConnectionString); var votesDAL = new VotesDAL(DbTestData.ConnectionString); var user = data.user1; dal.ReadById(user.ID).Should().NotBeNull(); projectsDAL.ReadAllByUserId(user.ID).Should().NotBeEmpty(); translationsDAL.ReadAllByUserId(user.ID).Should().NotBeEmpty(); votesDAL.ReadAllByUserId(user.ID).Should().NotBeEmpty(); dal.DeleteById(user.ID); dal.ReadById(user.ID).Should().BeNull(); projectsDAL.ReadAllByUserId(user.ID).Should().BeEmpty(); translationsDAL.ReadAllByUserId(user.ID).Should().BeEmpty(); votesDAL.ReadAllByUserId(user.ID).Should().BeEmpty(); } }
public List <Vote> GetAllByUserId(Guid userId) { return(_votesDAL.ReadAllByUserId(userId)); }