Exemplo n.º 1
0
            public void ToUserListVm_Should_Throw_Exception_When_Results_Is_Null()
            {
                GetUsersQueryResult results = null;

                IConfiguration config = GetConfig();

                UserListVm actual = UserModelHelper.ResultToUserListVm(results, config);
            }
Exemplo n.º 2
0
            public void ToUserListVm_Should_Throw_Exception_When_Config_Is_Null()
            {
                ICollection <User>  users   = new List <User>();
                GetUsersQueryResult results = new GetUsersQueryResult(users);

                IConfiguration config = null;

                UserListVm actual = UserModelHelper.ResultToUserListVm(results, config);
            }
Exemplo n.º 3
0
            public void ToUserListVm_Should_Return_UserListVm_When_No_Items_Found()
            {
                ICollection <User>  users   = new List <User>();
                GetUsersQueryResult results = new GetUsersQueryResult(users);

                IConfiguration config = GetConfig();

                UserListVm actual = UserModelHelper.ResultToUserListVm(results, config);

                Assert.AreEqual(MessagesModel.NoItemsFound, actual.Message);
                Assert.AreEqual(MessagesModel.MessageStyles.Info, actual.MessageStyle);
            }
Exemplo n.º 4
0
            public void ToUserListVm_Should_Return_UserListVm_When_Items_Found()
            {
                DateTime           date  = DateTime.Now;
                ICollection <User> users = new List <User>();
                User user = this.GetUser(true, "1");

                users.Add(user);
                user = this.GetUser(true, "2");
                users.Add(user);
                user = this.GetUser(true, "3");
                users.Add(user);
                GetUsersQueryResult results = new GetUsersQueryResult(users);

                IConfiguration config = GetConfig();

                UserListVm actual = UserModelHelper.ResultToUserListVm(results, config);

                Assert.AreEqual(3, actual.Users.Count);
            }