public void GetAllSourceMappingSystems() { using (TransactionScope scope = new TransactionScope()) { if (MappingController.DeleteAllMappings()) { if (MappingController.DeleteAllMappingSystems()) { MappingSystem mappingSystem = PopulateNewSourceMappingSystem(); mappingSystem.Id = MappingController.SaveMappingSystem(mappingSystem); if (mappingSystem.Id != -1) { //retrieve all mapping Systems and the one we saved should return at least List <MappingSystem> mappingSystems = MappingController.GetMappingSourceSystems(); //so the count should be >0 Assert.IsTrue(mappingSystems.Count > 0); //check for our new id Assert.IsTrue(mappingSystems.Find(delegate(MappingSystem currentItem) { return(currentItem.Id == mappingSystem.Id); }) != null); } } } } }
public void SaveDestinationMappingSystem() { using (TransactionScope scope = new TransactionScope()) { if (MappingController.DeleteAllMappings()) { if (MappingController.DeleteAllMappingSystems()) { Assert.IsTrue(MappingController.SaveMappingSystem(PopulateNewDestinationMappingSystem()) != -1); } } } }
public void SaveDestinationMappingSystemConstraint() { using (TransactionScope scope = new TransactionScope()) { MappingController.DeleteAllMappings(); MappingController.DeleteAllMappingSystems(); MappingSystem system = PopulateNewDestinationMappingSystem(); if (MappingController.SaveMappingSystem(system) != -1) { MappingController.SaveMappingSystem(system); } } }
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); }