public JobRepo(IAccountContextProvider accountContextProvider, ILogger logger, INotificationRepo notificationRepo, IPilotRepo pilotRepo) { _accountContextProvider = accountContextProvider; _logger = logger; _notificationRepo = notificationRepo; _pilotRepo = pilotRepo; }
public HomeController(IHostingEnvironment environment, UserManager <ApplicationUser> userManager, IConfigurationRoot configuration, INotificationRepo notificationRepo, ITestRepo testRepo) { this._environment = environment; this._userManager = userManager; this._location = configuration.GetSection("Environment")["Storage"]; this.testRepo = testRepo; this.notifyRepo = notificationRepo; }
public AdminController(UserManager <ApplicationUser> userManager, RoleManager <IdentityRole> roleManager, INotificationRepo notificationRepo, ITestRepo testRepo) { _userManager = userManager; _roleManager = roleManager; this.notifyRepo = notificationRepo; this.testRepo = testRepo; }
public UnitOfWork(ApplicationDbContext db) { _db = db; Gigs = new GigRepo(_db); Attendances = new AttendanceRepo(_db); Genres = new GenreRepo(_db); Followings = new FollowingRepo(_db); Notifications = new NotificationRepo(_db); }
public void NotificationRepository_DeleteById_ThrowsExceptionWhenIdNotFound() { //arrange INotificationRepo nr = GetInMemoryNotificationRepository(); //assert Assert.ThrowsAny <ArgumentNullException>(() => nr.DeleteById(0)); }
public ActionResult LoadAllAlert() { notifyRepo = new NotificationRepo(); repoResponse = new RepositoryResponse(); string _loggedInUserID = System.Web.HttpContext.Current.Session["UserID"].ToString(); repoResponse = notifyRepo.GetNotificationsByEmployeeNumber(_loggedInUserID); return(Json(new { success = repoResponse.success, message = repoResponse.message, Data = repoResponse.Data })); }
public NotificationService( IUnitWork unitWork, INotificationRepo repo, IGlobalMessageFactory globalMessageFactory, IMessageFactory messageFactory) { _unitWork = unitWork; _repo = repo; _globalMessageFactory = globalMessageFactory; _messageFactory = messageFactory; }
public void NotificationRepository_DeleteById_DeletesNotification() { //arrange INotificationRepo nr = GetInMemoryNotificationRepository(); //act nr.Add(notification); nr.DeleteById(1); //NotificationId should be 1 //assert Assert.ThrowsAny <ArgumentNullException>(() => nr.GetById(1)); }
public JsonResult LoadNewAltertForBellICon() { notifyRepo = new NotificationRepo(); repoResponse = new RepositoryResponse(); string _loggedInUserID = System.Web.HttpContext.Current.Session["UserID"].ToString(); repoResponse = notifyRepo.GetNotificationsByEmployeeNumberTOP3(_loggedInUserID); var sa = new JsonSerializerSettings(); return(Json(repoResponse.Data, JsonRequestBehavior.AllowGet)); //return Json(new { success = repoResponse.success, message = repoResponse.message, Data = repoResponse.Data }); }
public async Task SendAsync(Notification notification, INotificationRepo notificationRepo) { await TelegramBot._client.SendTextMessageAsync(notification.Receiver, notification.Content); var updateModel = new UpdateNotificationDto { NotificationId = notification.NotificationId, Status = NotificationStatus.Success, SendDateMi = DateTime.Now, SendStatus = "Success", IsLock = true }; await notificationRepo.UpdateAsync(updateModel); }
public void NotificationRepository_Add_AddsNotification() { //arrange INotificationRepo nr = GetInMemoryNotificationRepository(); //act nr.Add(notification); var savedNotification = nr.GetById(1); //assert Assert.Equal(1, savedNotification.ReceiverId); Assert.Equal(2, savedNotification.SenderId); Assert.Equal("like", savedNotification.Type); Assert.Equal(1, savedNotification.ReviewId); Assert.True(savedNotification.Status); }
public Task Create(NotificationDto notifyDto, INotificationRepo notificationRepo, int applicationId) { var notification = new Notification { TryCount = 0, Type = NotificationType.Sms, Status = NotificationStatus.Insert, ApplicationId = applicationId, ExtraData = notifyDto.UserId.ToString(), Content = notifyDto.Content, FullName = notifyDto.FullName, Receiver = notifyDto.MobileNumber.ToString() }; notificationRepo.AddAsync(notification); return(Task.CompletedTask); }
public void NotificationRepository_GetByUserId_ReturnsIEnumerable() { //arrange INotificationRepo nr = GetInMemoryNotificationRepository(); Notification notification2 = new Notification { Type = "like", ReceiverId = 1, SenderId = 3, Status = true, ReviewId = 2 }; //act nr.Add(notification); nr.Add(notification2); //assert Assert.IsAssignableFrom <IEnumerable <Notification> >(nr.GetByReceiverId(1)); }
public EvaluationService( IUnitWork unitWork, INotificationRepo repo, IGlobalMessageFactory globalMessageFactory, IMessageFactory messageFactory, IEvaluationRepo repo1, MedicalRepEvaluationsHandlers medicalRepHandlers, VisitAssertion visitAssertion, IVisitInteracting interacting, IMapper mapper, INotificationTypeRepo notificationTypeRepo ) : base(unitWork, repo, globalMessageFactory, messageFactory) { _unitWork = unitWork; _repo = repo1; _medicalRepHandlers = medicalRepHandlers; _visitAssertion = visitAssertion; _interacting = interacting; _mapper = mapper; _notificationTypeRepo = notificationTypeRepo; _eventBuilder = new EvaluationEventBuilder(_notificationTypeRepo); }
public void NotificationRepository_DeleteByUserId_DeletesNotifications() { //arrange INotificationRepo nr = GetInMemoryNotificationRepository(); Notification notification2 = new Notification { Type = "like", ReceiverId = 1, SenderId = 3, Status = true, ReviewId = 2 }; //act nr.Add(notification); nr.Add(notification2); nr.DeleteByUserId(1); //both notifications have same receiver id //assert Assert.ThrowsAny <ArgumentNullException>(() => nr.GetById(1)); Assert.ThrowsAny <ArgumentNullException>(() => nr.GetById(2)); }
public async Task SendAsync(Notification notification, INotificationRepo notificationRepo) { var sendResult = await LinePayamakProvider.SendSmsAsync(notification.Receiver, notification.Content); var updateModel = new UpdateNotificationDto { NotificationId = notification.NotificationId, SendDateMi = DateTime.Now, SendStatus = sendResult }; if (sendResult.Split(':')[1] == "1") { updateModel.Status = NotificationStatus.Success; updateModel.IsLock = true; } else { updateModel.Status = NotificationStatus.Failed; updateModel.IsLock = false; } await notificationRepo.UpdateAsync(updateModel); }
public Task SendAsync(Notification notification, INotificationRepo notifierUnitOfWork) { throw new NotImplementedException(); }
public NotificationService(INotificationRepo repo) : base(repo) { this.repo = repo; }
public NotificationService(INotificationRepo notificationRepo, IUserRepo userRepo, INotificationHub notificationHub) { this.notificationRepo = notificationRepo; this.userRepo = userRepo; this.notificationHub = notificationHub; }
public GlobalMessageReadingHandler(INotificationRepo notificationRepo, int repId) { _notificationRepo = notificationRepo; _repId = repId; }
public SkillRepo(IAccountContextProvider accountContextProvider, ILogger logger, INotificationRepo notificationRepo) { _logger = logger; _accountContextProvider = accountContextProvider; _notificationRepo = notificationRepo; }
public NotificationService() { this.Repository = new NotificationRepo(); }
public GlobalMessageRead(GlobalMessage globalMessage, INotificationRepo notificationRepo, int repId) { _globalMessage = globalMessage; _notificationRepo = notificationRepo; _repId = repId; }