Exemplo n.º 1
0
 public NotificationService(ApplicationDbContext context)
 {
     this.context               = context;
     notificationRepository     = new NotificationRepository(context);
     notificationTypeRepository = new NotificationTypeRepository(context);
     statusRepository           = new StatusRepository(context);
 }
Exemplo n.º 2
0
        public void SaveTestExistingChangeNotificationType()
        {
            // Arrange
            var expected = new NotificationTypeRepository(context).FindById(1);

            notificationRepository.Save(new Notification()
            {
                NotificationId   = 999999,
                NotificationType = new NotificationTypeRepository(context).FindById(2),
                CreatedDateTime  = DateTime.Now,
            });

            // Act
            var result = notificationRepository.FindById(999999);

            result.NotificationType = expected;
            notificationRepository.Save(result);

            // Assert
            Assert.AreEqual(expected, result.NotificationType);
        }
 public void TestInitialize()
 {
     // Arrange
     context = new ApplicationDbContext();
     notificationTypeRepository = new NotificationTypeRepository(context);
 }