예제 #1
0
        public void ThenAsstantShouldSeeFollowingParts(Table table)
        {
            var tableColumns = table.Header.ToArray();
            var todos        = new AssistantController(null).GetPresentation("what ever", "what ever").ToArray();

            Assert.AreEqual(todos.Select(t => t.Text).ToList(), table.Rows.Select(r => r["Text"]));
        }
예제 #2
0
        public void Login()
        {
            AssistantController controller = new AssistantController();


            ViewResult result = controller.Login() as ViewResult;

            //var controller = new AssistantController();
            //var result = controller.Login() as ViewResult;
            Assert.AreEqual("NOT", result.ViewBag.Message);
        }
        private AssistantController SetupDefaultController()
        {
            var assistantController = new AssistantController(_mockAssistantRepository);

            assistantController.ControllerContext             = new Mock <ControllerContext>().Object;
            assistantController.ControllerContext.HttpContext = new DefaultHttpContext();
            assistantController.HttpContext.Items             = new Dictionary <object, object?>
            {
                { "Id", 1L },
                { "AccountType", Filters.Roles.Assistant }
            };

            return(assistantController);
        }
 public AssistantControllerTests()
 {
     _mockAssistantRepository = new MockRepository <Assistant>();
     _mockAssistantController = this.SetupDefaultController();
 }