Example #1
0
 public Dto <Email> GetEmails(int page = 0, int limit = 10, int skip = 0, string startKey = null, string endKey = null, string startDocumentId = null, string endDocumentId = null, string sort = null)
 {
     try
     {
         return(_emailRepository.GetEmailList(page, limit, skip, startKey, endKey, startDocumentId, endDocumentId, sort));
     }
     catch (Exception ex)
     {
         throw HandleException(new object[] { page, limit, skip, startKey, endKey, startDocumentId, endDocumentId, sort }, ex);
     }
 }
        public void MenuRepo_GetMenu()
        {
            // Arrange
            EmailRepository _EmailRepo = new EmailRepository();
            EmailPoco       item1      = new EmailPoco();

            // Act
            _EmailRepo.AddPersonToEmailList(item1);
            List <EmailPoco> ItemList = _EmailRepo.GetEmailList();

            bool expected = true;
            bool actual   = ItemList.Contains(item1);

            // Assert
            Assert.AreEqual(expected, actual);
        }
        public void EmailRepositroy_AddItemToMenu()
        {
            EmailRepository _EmailRepo = new EmailRepository();
            EmailPoco       item1      = new EmailPoco();
            EmailPoco       item2      = new EmailPoco();
            EmailPoco       item3      = new EmailPoco();

            _EmailRepo.AddPersonToEmailList(item1);
            _EmailRepo.AddPersonToEmailList(item2);
            _EmailRepo.AddPersonToEmailList(item3);

            int actual   = _EmailRepo.GetEmailList().Count;
            int expected = 3;

            Assert.AreEqual(expected, actual);
        }
        public void MenuRepositroy_RemoveItemFromMenu()
        {
            EmailRepository _EmailRepo = new EmailRepository();
            EmailPoco       item1      = new EmailPoco();
            EmailPoco       item2      = new EmailPoco();
            EmailPoco       item3      = new EmailPoco();

            _EmailRepo.AddPersonToEmailList(item1);
            _EmailRepo.AddPersonToEmailList(item2);
            _EmailRepo.AddPersonToEmailList(item3);

            _EmailRepo.RemoveCustomerFromList(item3);

            int actual   = _EmailRepo.GetEmailList().Count;
            int expected = 2;

            Assert.AreEqual(expected, actual);
        }