Ejemplo n.º 1
0
        public ActionResult Index()
        {
            var model = new ListProjectModel();
            var objs  = ProjectLogic.GetByOwner(CurrentUserName);

            model.Projects = ModelConverter.Convert(objs);
            return(View(model));
        }
Ejemplo n.º 2
0
        public void GetByOwner_No_Projects_Found()
        {
            //arrange
            var mockRepository = new Mock <IInnerTrackRepository>();
            var username       = "******";

            mockRepository.Setup(m => m.GetProjects(It.Is <ProjectFilter>(f => f.OwnersUserName == username))).Returns(new List <ProjectObj>());
            var logic = new ProjectLogic(mockRepository.Object);

            //act
            var actual = logic.GetByOwner(username);

            //assert
            Assert.IsNotNull(actual);
            Assert.AreEqual(0, actual.Count);
        }