public void SetData(EditContactEntity entity)
 {
     _view.SetCity(entity.City);
     _view.SetCountry(entity.Country);
     _view.SetEmail(entity.Email);
     _view.SetSkype(entity.Skype);
     _view.SetPhone(entity.Phone);
 }
        public void GetModelOneParam()
        {
            var entity   = new EditContactEntity("email", "skype", "country", "city", "phone");
            var modelDTO = _modelCreator.GetRequestModel(entity);

            var modelAct = modelDTO.GetType().GetRuntimeFields().First(f => f.Name.Equals("_entity")).GetValue(modelDTO);

            Assert.AreEqual(entity, modelAct);
        }
        public void GetModelNoParams()
        {
            var modelExp = new EditContactEntity("email", "skype", "country", "city", "phone");

            _repository.EditContactUserInfo = new DataModelUserInfo("", "", "", "", "", "email", "phone", "", "skype", "country", "city",
                                                                    "", false, new string[] {});

            var modelAct = _modelCreator.GetModel();

            Assert.AreEqual(modelExp, modelAct);
        }
        public void EditContactEntityTest(string email, string skype, string country, string city, string phone)
        {
            var model = new EditContactEntity(email, skype, country, city, phone);

            var result = email == model.Email;

            result &= skype == model.Skype;
            result &= country == model.Country;
            result &= city == model.City;
            result &= phone == model.Phone;

            Assert.IsTrue(result);
        }
Esempio n. 5
0
        public void EditContactDTOTest()
        {
            var entity   = new EditContactEntity("email", "skype", "country", "city", "phone");
            var modelAct = new UserInfoDTO(entity);

            var modelExp = new UserInfoDTO(entity)
            {
                Method  = ERestCommands.PUT,
                ApiPath = "/api/v3/update_personal_info"
            };

            modelExp.GetType().GetRuntimeFields().First(f => f.Name.Equals("_entity")).SetValue(modelExp, entity);

            var result = modelExp.Equals(modelAct);

            Assert.IsTrue(result);
        }
        public void GetModelTest_NullParams(string email, string skype, string country, string city, string phone)
        {
            var modelExp = new EditContactEntity(email: email, skype: skype, country: country, city: city, phone: phone);

            _repository.EditContactUserInfo = new DataModelUserInfo(
                id: "",
                first_name: "",
                last_name: "",
                nickname: "",
                image: "",
                email: email,
                phone: phone,
                phone_2: "",
                skype: skype,
                country: country,
                city: city,
                status: "",
                isNickName: false,
                errors: new string[] { });

            var modelAct = _modelCreator.GetModel();

            Assert.AreEqual(modelExp, modelAct);
        }