private void LoadUserTypes() { var types = Utils.GetDefaultUserTypeList(); foreach (var type in types) { var x = UserTypeRepository.Add(type); } }
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); }
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); }
public Response Post([FromBody] UserTypes value) { return(repo.Add(value)); }