private static void AddDetailsToEntity(PartyRole entity, DateTime startDate, DateTime endDate) { var newEntity = ObjectMother.Create <PartyRole>(); entity.PartyRoleType = newEntity.PartyRoleType; entity.AddDetails(newEntity.LatestDetails); }
protected static void Because_of() { entity = PartyRoleData.CreateBasicEntityWithOneMapping(); mapping = entity.Mappings[0]; client = new HttpClient(ServiceUrl["PartyRole"] + string.Format("{0}/mapping/{1}", entity.Id, mapping.Id)); response = client.Get(); mappingResponse = response.Content.ReadAsDataContract<EnergyTrading.Mdm.Contracts.MappingResponse>(); }
protected static void Because_of() { entity = PartyRoleData.CreateBasicEntityWithOneMapping(); mapping = entity.Mappings[0]; client = new HttpClient(ServiceUrl["PartyRole"] + string.Format("{0}/mapping/{1}", entity.Id, mapping.Id)); response = client.Get(); mappingResponse = response.Content.ReadAsDataContract <EnergyTrading.Mdm.Contracts.MappingResponse>(); }
public static PartyRole CreateEntityWithTwoDetailsAndTwoMappings() { SourceSystem endur = repository.Queryable <SourceSystem>().Where(system => system.Name == "Endur").First(); SourceSystem trayport = repository.Queryable <SourceSystem>().Where(system => system.Name == "Trayport").First(); var entity = new PartyRole(); entity.Party = ObjectMother.Create <MDM.Party>(); baseDate = DateTime.Today.Subtract(new TimeSpan(72, 0, 0)); SystemTime.UtcNow = () => new DateTime(DateTime.Today.Subtract(new TimeSpan(73, 0, 0)).Ticks); AddDetailsToEntity(entity, DateTime.MinValue, baseDate); AddDetailsToEntity(entity, baseDate, DateTime.MaxValue); SystemTime.UtcNow = () => DateTime.Now; var trayportMapping = new PartyRoleMapping { MappingValue = Guid.NewGuid().ToString(), System = trayport, Validity = new DateRange(DateTime.MinValue, DateTime.MaxValue) }; var endurMapping = new PartyRoleMapping { MappingValue = Guid.NewGuid().ToString(), System = endur, IsDefault = true, Validity = new DateRange(DateTime.MinValue, DateTime.MaxValue) }; entity.ProcessMapping(trayportMapping); entity.ProcessMapping(endurMapping); repository.Add(entity); repository.Flush(); return(entity); }
public static PartyRole CreateEntityWithTwoDetailsAndTwoMappings() { SourceSystem endur = repository.Queryable<SourceSystem>().Where(system => system.Name == "Endur").First(); SourceSystem trayport = repository.Queryable<SourceSystem>().Where(system => system.Name == "Trayport").First(); var entity = new PartyRole(); entity.Party = ObjectMother.Create<MDM.Party>(); baseDate = DateTime.Today.Subtract(new TimeSpan(72, 0, 0)); SystemTime.UtcNow = () => new DateTime(DateTime.Today.Subtract(new TimeSpan(73, 0, 0)).Ticks); AddDetailsToEntity(entity, DateTime.MinValue, baseDate); AddDetailsToEntity(entity, baseDate, DateTime.MaxValue); SystemTime.UtcNow = () => DateTime.Now; var trayportMapping = new PartyRoleMapping { MappingValue = Guid.NewGuid().ToString(), System = trayport, Validity = new DateRange(DateTime.MinValue, DateTime.MaxValue) }; var endurMapping = new PartyRoleMapping { MappingValue = Guid.NewGuid().ToString(), System = endur, IsDefault = true, Validity = new DateRange(DateTime.MinValue, DateTime.MaxValue) }; entity.ProcessMapping(trayportMapping); entity.ProcessMapping(endurMapping); repository.Add(entity); repository.Flush(); return entity; }
private static void CreateSearchData(Search search, PartyRole entity1, PartyRole entity2) { search.AddSearchCriteria(SearchCombinator.Or) .AddCriteria("Name", SearchCondition.Equals, entity1.LatestDetails.Name) .AddCriteria("Name", SearchCondition.Equals, entity2.LatestDetails.Name); }
private static void AddDetailsToEntity(PartyRole entity, DateTime startDate, DateTime endDate) { var newEntity = ObjectMother.Create<PartyRole>(); entity.PartyRoleType = newEntity.PartyRoleType; entity.AddDetails(newEntity.LatestDetails); }
public static void CreateSearch(Search search, PartyRole entity1, PartyRole entity2) { CreateSearchData(search, entity1, entity2); }
private static void CreateSearchData(Search search, PartyRole entity1, PartyRole entity2) { search.AddSearchCriteria(SearchCombinator.Or) .AddCriteria("Name", SearchCondition.Equals, entity1.LatestDetails.Name) .AddCriteria("Name", SearchCondition.Equals, entity2.LatestDetails.Name); }
public static void CreateSearch(Search search, PartyRole entity1, PartyRole entity2) { CreateSearchData(search, entity1, entity2); }