Inheritance: Chaos.Portal.Core.Data.Model.AResult
		public UserProfile(Metadata metadata)
		{
			MetadataSchemaGuid = metadata.MetadataSchemaGuid;
			EditingUserGuid = metadata.EditingUserGuid;
			MetadataXml = metadata.MetadataXml;
			DateCreated = metadata.DateCreated;
		}
		public void Update_GivenExistingUsersAttributesWithChanges_UpdateUserObjectReturnSuccess()
		{
			var extension = Make_WayfProfileExtension();
			var user = new UserInfo
			{
				Guid = new Guid("63a0348b-ab4b-8847-9c71-2d0b4771b0fe"),
				Email = "*****@*****.**"
			};
			var existingMetadata = new Metadata
			{
				Guid = new Guid("70a0348b-ab4b-8847-9c71-2d0b4771b0ff"),
				MetadataSchemaGuid = Settings.UserProfileMetadataSchemaGuid,
				MetadataXml = XDocument.Parse("<CHAOS.Profile></CHAOS.Profile>"),
				RevisionID = 3
			};
			var userObject = new Mcm.Data.Dto.Object
			{
				Guid = user.Guid,
				Metadatas = new List<Metadata>
				{
					new Metadata{Guid = new Guid("70a0348b-ab4b-8847-0000-2d0b4771b0ff")},
					existingMetadata
				}
			};

			PortalRequest.SetupGet(r => r.User).Returns(Make_UserManager());
			PortalRepository.Setup(r => r.UserInfoGet(user.Guid, null, null, null)).Returns(new List<UserInfo> { user });
			McmRepository.Setup(r => r.ObjectGet(user.Guid, true, false, false, false, false)).Returns(userObject).Verifiable();
			McmRepository.Setup(r => r.MetadataSet(user.Guid, existingMetadata.Guid, Settings.UserProfileMetadataSchemaGuid, Settings.UserProfileLanguageCode, 4, It.Is<XDocument>(x => x.ToString(SaveOptions.DisableFormatting) == CHAOS_PROFILE), user.Guid)).Returns(1).Verifiable();

			var result = extension.Update(user.Guid, WAYF_ATTRIBUTES);

			McmRepository.Verify();

			Assert.That(result, Is.Not.Null);
			Assert.That(result.Value, Is.EqualTo(1));
		}
		public void Update_GivenExistingUsersAttributesWithSomeEmptyProperties_UpdateUserObjectReturnSuccess()
		{
			var extension = Make_WayfProfileExtension();
			const string expectedXmlString = "<CHAOS.Profile><Name>Jens farmer</Name><Title>Walker</Title><About></About><Organization>Institut</Organization><Emails><Email>[email protected]</Email></Emails><Phonenumbers><Phonenumber></Phonenumber></Phonenumbers><Websites><Website></Website></Websites><Skype></Skype><LinkedIn></LinkedIn><Twitter></Twitter><Address></Address><City></City><ZipCode></ZipCode><Country>Denmark</Country></CHAOS.Profile>";
			var user = new UserInfo
			{
				Guid = new Guid("63a0348b-ab4b-8847-9c71-2d0b4771b0fe"),
				Email = "*****@*****.**"
			};
			var existingMetadata = new Metadata
			{
				Guid = new Guid("70a0348b-ab4b-8847-9c71-2d0b4771b0ff"),
				MetadataSchemaGuid = Settings.UserProfileMetadataSchemaGuid,
				MetadataXml = XDocument.Parse("<CHAOS.Profile><Name></Name><Title>Walker</Title><About></About><Organization>Institut</Organization><Emails><Email></Email></Emails><Phonenumbers><Phonenumber></Phonenumber></Phonenumbers><Websites><Website></Website></Websites><Skype></Skype><LinkedIn></LinkedIn><Twitter></Twitter><Address></Address><City></City><ZipCode></ZipCode><Country>Denmark</Country></CHAOS.Profile>"),
				RevisionID = 3
			};
			var userObject = new Mcm.Data.Dto.Object
			{
				Guid = user.Guid,
				Metadatas = new List<Metadata>
				{
					new Metadata{Guid = new Guid("70a0348b-ab4b-8847-0000-2d0b4771b0ff")},
					existingMetadata
				}
			};

			PortalRequest.SetupGet(r => r.User).Returns(Make_UserManager());
			PortalRepository.Setup(r => r.UserInfoGet(user.Guid, null, null, null)).Returns(new List<UserInfo> { user });
			McmRepository.Setup(r => r.ObjectGet(user.Guid, true, false, false, false, false)).Returns(userObject).Verifiable();
			McmRepository.Setup(r => r.MetadataSet(user.Guid, existingMetadata.Guid, Settings.UserProfileMetadataSchemaGuid, Settings.UserProfileLanguageCode, 4, It.Is<XDocument>(x => x.ToString(SaveOptions.DisableFormatting) == expectedXmlString), user.Guid)).Returns(1).Verifiable();

			var result = extension.Update(user.Guid, PARTIAL_WAYF_ATTRIBUTES);

			McmRepository.Verify();

			Assert.That(result, Is.Not.Null);
			Assert.That(result.Value, Is.EqualTo(1));
		}