public TranslationBL( TranslationsDAL translationsDAL, PhrasesDAL phrasesDAL, ProjectsDAL projectsDAL ) { _translationsDAL = translationsDAL; _phrasesDAL = phrasesDAL; _projectsDAL = projectsDAL; }
public void CanDelete() { using (var data = new DbTestData()) { var translationsDAL = new TranslationsDAL(DbTestData.ConnectionString); var phraseId = data.phrase1.ID; dal.ReadById(phraseId).Should().NotBeNull(); translationsDAL.ReadAllByPhraseId(phraseId).Should().NotBeEmpty(); dal.DeleteById(phraseId); dal.ReadById(phraseId).Should().BeNull(); translationsDAL.ReadAllByPhraseId(phraseId).Should().BeEmpty(); } }
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 static void Init(TestContext context) { dal = new TranslationsDAL(DbTestData.ConnectionString); }