Ejemplo n.º 1
0
        public void For_Users_Given_AnyType_ResultsIs_ListOfUsers()
        {
            int type = 2;
            var access = new DataAccess();
            var db = new UserRepository(access);

            var result = db.GetList(type);

            Assert.AreEqual(3, result.Count());
        }
Ejemplo n.º 2
0
        public UserModule()
        {
            dataAccess = new DataAccess();

            repo = new UserRepository(dataAccess);

            Get["/"] = _ => "Hello Nancy";

            Get["/user"] = parameters =>
            {
                var usersList = repo.GetList((int) UserType.Learner).Select(x => new UserViewModel(x)).ToList();
                return View["User.cshtml", usersList];
            };
        }