Exemplo n.º 1
0
        public void SendNotificationToGroup_ShouldFailWithNotWorkingApiCalls()
        {
            INotificationRepository     notificationRepository = new NotificationRepository(failingApiCalls, apiConfig, logger);
            UploadableGroupNotification notification           = new UploadableGroupNotification();
            Boolean expected = false;

            Boolean actual = notificationRepository.SendNotificationToGroup(notification);

            Assert.Equal(expected, actual);
        }
Exemplo n.º 2
0
        public IActionResult SendNotificationToGroup(UploadableGroupNotification notification)
        {
            if (ModelState.IsValid)
            {
                Boolean isNotificationSend = repository.SendNotificationToGroup(notification);

                if (isNotificationSend)
                {
                    ViewBag.IsNotificationAdded = true;
                    return(View("Index", repository.GetAll()));
                }
            }

            ViewBag.IsNotificationAdded = false;
            return(View("Index", repository.GetAll()));
        }