Пример #1
0
        public void EditUserSelectedFacilityListIsNull()
        {
            var mockUserRepository = new Mock <IUserRepository>();
            // Arrange
            List <Facility> selectedFacilityList = new List <Facility>
            {
                new Facility
                {
                    FacilityId   = 0,
                    FacilityName = ""
                }
            };
            User user = new User
            {
                UserId               = 16,
                UserGuid             = new Guid(),
                UserName             = "******",
                FirstName            = "T",
                LastName             = "",
                MiddleName           = "",
                IsLocked             = false,
                UserTypeId           = 2,
                SelectedFacility     = "0",
                SelectedFacilityList = selectedFacilityList
            };
            User expectedResult = new User
            {
                UserId = 0
            };

            mockUserRepository.Setup(f => f.AddEditUser(user)).Returns(expectedResult);
            _target = new UserLogic(mockUserRepository.Object);
            //Act
            User actual = _target.AddEditUser(user);

            // Assert
            Assert.AreEqual(expectedResult.UserId, actual.UserId);
        }
Пример #2
0
 /// <summary>
 /// Add/edit User basic information.
 /// </summary>
 /// <param name="userInfo">The User.</param>
 /// <returns></returns>
 public User AddEditUser(User userInfo)
 {
     return(_userLogic.AddEditUser(userInfo));
 }