public void SetUp()
        {
            _mockNotificationRepository = new Mock <INotificationRepository>();

            _mockUnitOfWork = new Mock <IUnitOfWork>();
            _mockUnitOfWork.SetupGet(u => u.Notifications).Returns(_mockNotificationRepository.Object);

            _controller = new NotificationsController(_mockUnitOfWork.Object);
            _controller.MockCurrentUser(_UserId, _UserName);
        }
示例#2
0
        public void TestInitialize()
        {
            _userId = "1";

            var mockUoW = new Mock <IUnitOfWork>();

            _mockRepo = new Mock <INotificationRepo>();
            mockUoW.SetupGet(r => r.Notifications).Returns(_mockRepo.Object);

            _controller = new NotificationsController(mockUoW.Object);
            _controller.MockCurrentUser(_userId, "*****@*****.**");
        }
        public void TestInitialize()
        {
            _mockRepository = new Mock <IUserNotificationRepository>();

            var mockUoW = new Mock <IUnitOfWork>();

            mockUoW.SetupGet(u => u.UserNotifications).Returns(_mockRepository.Object);

            _controller = new NotificationsController(mockUoW.Object);
            _userId     = "1";
            _controller.MockCurrentUser(_userId, "*****@*****.**");
        }
        public void SetUp()
        {
            _mockRepository = new Mock <INotificationRepository>();
            _mockUserNotificationRepository = new Mock <IUserNotificationRepository>();

            var mockUnitOfWork = new Mock <IUnitOfWork>();

            mockUnitOfWork.SetupGet(u => u.Notifications).Returns(_mockRepository.Object);
            mockUnitOfWork.SetupGet(u => u.UserNotifications).Returns(_mockUserNotificationRepository.Object);

            _controller = new NotificationsController(mockUnitOfWork.Object);
            _userId     = "1";
            _controller.MockCurrentUser(_userId, "*****@*****.**");
        }