Beispiel #1
0
        public void SendNotification_ShouldFailWithNotWorkingApiCalls()
        {
            INotificationRepository notificationRepository = new NotificationRepository(failingApiCalls, apiConfig, logger);
            UploadableNotification  notification           = new UploadableNotification();
            Boolean expected = false;

            Boolean actual = notificationRepository.SendNotification(notification);

            Assert.Equal(expected, actual);
        }
Beispiel #2
0
        public IActionResult SendNotification(UploadableNotification notification)
        {
            if (ModelState.IsValid)
            {
                Boolean isNotificationSend = repository.SendNotification(notification);

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

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