public void SaveMappingPropertyAssociation() { using (TransactionScope scope = new TransactionScope()) { if (MappingController.DeleteAllMappings()) { if (MappingController.DeleteAllMappingSystems()) { if (MappingController.DeleteAllMappingPropertyAssociations()) { if (MappingController.DeleteAllMappingClassAssociations()) { Assert.IsTrue(MappingController.SaveMappingPropertyAssociation(PopulateNewMappingPropertyAssocation()) != -1); } } } } } }
internal Mapping PopulateMappingItem() { Mapping mapping = new Mapping(); //Add two mapping systems mapping.DestinationSystem = PopulateNewDestinationMappingSystem(); mapping.DestinationSystem.Id = MappingController.SaveMappingSystem(mapping.DestinationSystem); mapping.DestinationSystemId = mapping.DestinationSystem.Id; mapping.SourceSystem = PopulateNewSourceMappingSystem(); mapping.SourceSystem.Id = MappingController.SaveMappingSystem(mapping.SourceSystem); mapping.SourceSystemId = mapping.SourceSystem.Id; //add a mapping property association, which describes when properties can be mapped on the above type mapping.MappingPropertyAssociation = PopulateNewMappingPropertyAssocation(); mapping.MappingPropertyAssociation.Id = MappingController.SaveMappingPropertyAssociation(mapping.MappingPropertyAssociation); mapping.MappingPropertyAssociationId = mapping.MappingPropertyAssociation.Id; mapping.DestinationValue = "Test"; mapping.SourceValue = "test"; mapping.UpdatedBy = "test"; return(mapping); }