public ContactAllAttributesDTO GetContactAttributes(string token, int contactId) { var mpAttributes = _mpAttributeService.GetAttributes(null); var mpContactAttributes = _mpContactAttributeService.GetCurrentContactAttributes(token, contactId, false); var allAttributes = new ContactAllAttributesDTO(); allAttributes.MultiSelect = TranslateToAttributeTypeDtos(mpContactAttributes, mpAttributes); allAttributes.SingleSelect = TranslateToSingleAttributeTypeDtos(mpContactAttributes, mpAttributes); return allAttributes; }
public void SetUp() { _contactAttributeService = new Mock<IContactAttributeService>(); var contactAllAttributesDto = new ContactAllAttributesDTO(); _contactAttributeService.Setup(mocked => mocked.GetContactAttributes(It.IsAny<string>(), It.IsAny<int>())).Returns(contactAllAttributesDto); _contactService = new Mock<MPInterfaces.IContactService>(); _authenticationService = new Mock<MPInterfaces.IAuthenticationService>(); _participantService = new Mock<MPInterfaces.IParticipantService>(); _apiUserService = new Mock<MPInterfaces.IApiUserService>(); _apiUserService.Setup(m => m.GetToken()).Returns("something"); _authenticationService.Setup(mocked => mocked.GetContactId(It.IsAny<string>())).Returns(123456); _myContact = new MyContact { Contact_ID = 123456, Email_Address = "*****@*****.**", Last_Name = "last-name", Nickname = "nickname", First_Name = "first-name", Middle_Name = "middle-name", Maiden_Name = "maiden-name", Mobile_Phone = "mobile-phone", Mobile_Carrier = 999, Date_Of_Birth = "date-of-birth", Marital_Status_ID = 5, Gender_ID = 2, Employer_Name = "employer-name", Address_Line_1 = "address-line-1", Address_Line_2 = "address-line-2", City = "city", State = "state", Postal_Code = "postal-code", Foreign_Country = "foreign-country", Home_Phone = "home-phone", Congregation_ID = 8, Household_ID = 7, Household_Name = "hh name", Address_ID = 6, Attendance_Start_Date = startDate }; _householdMembers = new List<HouseholdMember>(); _fixture = new PersonService(_contactService.Object, _contactAttributeService.Object, _apiUserService.Object, _participantService.Object); //force AutoMapper to register AutoMapperConfig.RegisterMappings(); }