예제 #1
0
        private void LoadUserTypes()
        {
            var types = Utils.GetDefaultUserTypeList();

            foreach (var type in types)
            {
                var x = UserTypeRepository.Add(type);
            }
        }
예제 #2
0
        private UserType AddandGetTestUserType()
        {
            var userTypeType = new UserType
            {
                Description = "TestUserType"
            };

            using (var userTypeRepo = new UserTypeRepository(new brothershipEntities(ConnectionStrings.TEST_CONNECTION_STRING_NAME)))
            {
                userTypeRepo.Add(userTypeType);
                userTypeRepo.SaveChanges();
            }

            return(userTypeType);
        }
예제 #3
0
        public void Add_WasUserTypeAdded_ActualEqualsExpectedData()
        {
            var expectedUserType = new UserType
            {
                Description = "NewTestType"
            };
            UserType actualUserType;

            using (var userTypeRepo = new UserTypeRepository(new brothershipEntities(ConnectionStrings.TEST_CONNECTION_STRING_NAME)))
            {
                userTypeRepo.Add(expectedUserType);
                userTypeRepo.SaveChanges();
                actualUserType = userTypeRepo.GetById(expectedUserType.ID);
            }

            AssertUserTypesEqual(expectedUserType, actualUserType);
        }
예제 #4
0
 public Response Post([FromBody] UserTypes value)
 {
     return(repo.Add(value));
 }