示例#1
0
        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));
        }