コード例 #1
0
 public TranslationBL(
     TranslationsDAL translationsDAL,
     PhrasesDAL phrasesDAL,
     ProjectsDAL projectsDAL
     )
 {
     _translationsDAL = translationsDAL;
     _phrasesDAL      = phrasesDAL;
     _projectsDAL     = projectsDAL;
 }
コード例 #2
0
        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();
            }
        }
コード例 #3
0
ファイル: UsersDALTest.cs プロジェクト: anaspoiala/borderless
        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();
            }
        }
コード例 #4
0
 public static void Init(TestContext context)
 {
     dal = new TranslationsDAL(DbTestData.ConnectionString);
 }