Beispiel #1
0
        public async void GetAllAppealByEmailTest()
        {
            var appeal = new Appeal()
            {
                Email = "*****@*****.**",
                Text  = "Text1"
            };

            var appeal1 = new Appeal()
            {
                Email = "*****@*****.**",
                Text  = "Text2"
            };

            var repos = new AppealRepository(new AppDbContext());

            repos.Add(appeal);
            repos.Add(appeal1);

            var appeals = await repos.GetEntitiesByEmail("*****@*****.**");

            Assert.IsTrue(appeals.ToList().Count() > 1);

            repos.Delete(appeal);
            repos.Delete(appeal1);
        }
Beispiel #2
0
        public async void GetAppealByIdTest()
        {
            var appeal = new Appeal()
            {
                Email = "*****@*****.**",
                Text  = "Этот текст для теста"
            };

            var repos1 = new AppealRepository(new AppDbContext());

            repos1.Add(appeal);
            var keyAppeal = await repos1.GetIdByEmailAndTextAsync(appeal.Email, appeal.Text);

            var appealFromDb = repos1.Get(keyAppeal);

            Assert.AreEqual(appeal.Email, appealFromDb.Email);
            repos1.Delete(appeal);
        }