public void FindByIdTestNotNull() { // Act var result = notificationTypeRepository.FindById(1); // Assert Assert.IsInstanceOfType(result, typeof(NotificationType)); }
public Notification CreateUnableToFulFillNotification(Retrieval retrieval, ApplicationUser recipient) { Notification notification = InstantiateNotification(recipient); var requisitionRepository = new RequisitionRepository(context); notification.NotificationType = notificationTypeRepository.FindById(8); notification.Contents = String.Format("Your recent requisitions could not be fulfilled due to low stock count. We have automatically generated a new Requisition with ID: {0} on your behalf for the next retrieval cycle.", requisitionRepository.FindAll() .Where(r => r.RequisitionId.StartsWith("SRQ") && r.EmployeeRemarks.Contains(retrieval.RetrievalId) && r.Department.DepartmentCode == recipient.Department.DepartmentCode) .FirstOrDefault().RequisitionId); return(this.Save(notification)); }