public SecuritySearchRequest(PagingRequest pagingRequest, string name, string securityType, ExternalIdSearch externalIdSearch, List<ObjectId> objectIds) { _pagingRequest = pagingRequest; _objectIds = objectIds; _externalIdSearch = externalIdSearch; _name = name; _securityType = securityType; }
public SecuritySearchRequest(PagingRequest pagingRequest, string name, string securityType, ExternalIdSearch externalIdSearch) : this(pagingRequest, name, securityType, externalIdSearch, null) { }
public void CanSearchWithRequest() { var request = new SecuritySearchRequest(PagingRequest.First(20), "*", "FUTURE"); var searchResult = Context.SecurityMaster.Search(request); Assert.NotEmpty(searchResult.Documents); var securitytoFind = searchResult.Documents.First(); var identifierBundle = securitytoFind.Security.Identifiers; { var identifierSearch = new ExternalIdSearch(identifierBundle.Identifiers, ExternalIdSearchType.All); request = new SecuritySearchRequest(PagingRequest.All, "*", "FUTURE", identifierSearch); var singleSearchResult = Context.SecurityMaster.Search(request); Assert.NotEmpty(singleSearchResult.Documents); Assert.Single(singleSearchResult.Documents); Assert.Equal(singleSearchResult.Documents.Single().Security.UniqueId, securitytoFind.UniqueId); } { var identifierSearch = new ExternalIdSearch(identifierBundle.Identifiers.Concat(Enumerable.Repeat(ExternalId.Create("XXX", "YYY"), 1)), ExternalIdSearchType.Any); request = new SecuritySearchRequest(PagingRequest.All, "*", "FUTURE", identifierSearch); var singleSearchResult = Context.SecurityMaster.Search(request); Assert.NotEmpty(singleSearchResult.Documents); Assert.Single(singleSearchResult.Documents); Assert.Equal(singleSearchResult.Documents.Single().Security.UniqueId, securitytoFind.UniqueId); } }