示例#1
0
        public void When_get_then_result_is_list_ofUsers()
        {
            //Setup
            var users = new List <User>
            {
                new User()
                {
                    Id = "Korzh"
                },

                new User()
                {
                    Id = "Nice"
                }
            };

            repoMock
            .Setup(r => r.Get())
            .Returns(users);
            //Act

            var userfromDb = userList.Get();

            //Assert

            Assert.Equal(users, userfromDb);
        }
        protected override void Execute(CodeActivityContext context)
        {
            List <UserWithIndex> toret = new List <UserWithIndex>();
            int i = 0;

            foreach (User u in UserList.Get(context))
            {
                toret.Add(new UserWithIndex(u, i));
                i++;
            }
            UserListWithIndex.Set(context, toret);
        }
示例#3
0
        public IActionResult Index()
        {
            var users = userList.Get();

            return(View(users));
        }