Esempio n. 1
0
        // ------------------------------- Utility -------------------------------
        private (WebmailContext, IMessageService) CreateTestTools(string name)
        {
            var context = CreateTestContext(name);
            var service = new SqlMessageService(context);

            return(context, service);
        }
Esempio n. 2
0
        // ---------------------------------- Utility ----------------------------------
        private (WebmailContext, InboxController) CreateTestTools(string name)
        {
            var context        = CreateTestContext(name);
            var messageService = new SqlMessageService(context);
            var controller     = new InboxController(new SqlUserService(context, messageService), messageService)
            {
                ControllerContext = new ControllerContext
                {
                    HttpContext = new DefaultHttpContext {
                        User = new ClaimsPrincipal()
                    }
                }
            };

            return(context, controller);
        }