Example #1
0
        protected static void Establish_context()
        {
            counterparty = CounterpartyData.CreateContractForEntityCreation();

            content = HttpContentExtensions.CreateDataContract(counterparty);
            client  = new HttpClient();
        }
        protected static void Establish_context()
        {
            client = new HttpClient();
            entity = CounterpartyData.CreateBasicEntity();

            content      = HttpContentExtensions.CreateDataContract(new EnergyTrading.MDM.Contracts.Sample.Counterparty());
            startVersion = CurrentEntityVersion();
        }
Example #3
0
        protected static void Because_of()
        {
            var entity = CounterpartyData.CreateBasicEntityWithOneMapping();

            client = new HttpClient(ServiceUrl["Counterparty"] + string.Format("{0}/mapping/{1}", entity.Id, int.MaxValue));

            response = client.Get();
        }
        protected static void Establish_context()
        {
            entity = CounterpartyData.CreateBasicEntity();
            var notAMapping = new EnergyTrading.MDM.Contracts.Sample.Counterparty();

            content = HttpContentExtensions.CreateDataContract(notAMapping);
            client  = new HttpClient();
        }
        protected static void Because_of()
        {
            entity  = CounterpartyData.CreateBasicEntityWithOneMapping();
            mapping = entity.Mappings[0];
            client  = new HttpClient(ServiceUrl["Counterparty"] + string.Format("{0}/mapping/{1}", entity.Id, mapping.Id));

            response        = client.Get();
            mappingResponse = response.Content.ReadAsDataContract <EnergyTrading.Mdm.Contracts.MappingResponse>();
        }
        protected static void Establish_context()
        {
            entity = CounterpartyData.CreateBasicEntityWithOneMapping();
            client = new HttpClient();
            var notAMapping = new MDM.Counterparty();

            content      = HttpContentExtensions.CreateDataContract(notAMapping);
            startVersion = CurrentEntityVersion();
        }
        protected static void Establish_context()
        {
            client = new HttpClient();
            entity = CounterpartyData.CreateBasicEntity();
            var getResponse = client.Get(ServiceUrl["Counterparty"] + entity.Id);

            updatedContract = getResponse.Content.ReadAsDataContract <EnergyTrading.MDM.Contracts.Sample.Counterparty>();
            content         = HttpContentExtensions.CreateDataContract(CounterpartyData.MakeChangeToContract(updatedContract));
        }
        protected static void Because_of()
        {
            entity = CounterpartyData.CreateEntityWithTwoDetailsAndTwoMappings();

            client = new HttpClient(ServiceUrl["Counterparty"] +
                                    "crossmap?source-system=trayport&destination-system=endur&mapping-string=" + entity.Mappings[0].MappingValue
                                    + "&as-of=" + entity.Mappings[0].Validity.Start.ToString(DateFormatString));

            response        = client.Get();
            mappingResponse = response.Content.ReadAsDataContract <EnergyTrading.Mdm.Contracts.MappingResponse>();
        }
        protected static void Establish_context()
        {
            entity1 = CounterpartyData.CreateBasicEntity();
            entity2 = CounterpartyData.CreateBasicEntity();

            client = new HttpClient();

            var search = new Search().IsMutliPage().MaxPageSize(1);

            CounterpartyData.CreateSearch(search, entity1, entity2);

            content = HttpContentExtensions.CreateDataContract(search);
        }
        protected static void Establish_context()
        {
            entity1 = CounterpartyData.CreateBasicEntityWithOneMapping();

            client = new HttpClient();

            Search search = SearchBuilder.CreateSearch(isMappingSearch: true);

            search.AddSearchCriteria(SearchCombinator.And).AddCriteria(
                "MappingValue", SearchCondition.Equals, entity1.Mappings[0].MappingValue).AddCriteria(
                "System.Name", SearchCondition.Equals, "Endur");

            content = HttpContentExtensions.CreateDataContract(search);
        }
Example #11
0
        protected static void Establish_context()
        {
            entity  = CounterpartyData.CreateBasicEntity();
            mapping = new EnergyTrading.Mdm.Contracts.Mapping {
                SystemName             = "Endur",
                Identifier             = Guid.NewGuid().ToString(),
                SourceSystemOriginated = false,
                DefaultReverseInd      = false,
                StartDate = Script.baseDate,
                EndDate   = Script.baseDate.AddDays(2)
            };

            content = HttpContentExtensions.CreateDataContract(mapping);
            client  = new HttpClient();
        }
        protected static void Establish_context()
        {
            entity = CounterpartyData.CreateBasicEntityWithOneMapping();
            currentTrayportMapping = entity.Mappings[0];

            mapping = new EnergyTrading.Mdm.Contracts.Mapping {
                SystemName             = currentTrayportMapping.System.Name,
                Identifier             = currentTrayportMapping.MappingValue,
                SourceSystemOriginated = currentTrayportMapping.IsMaster,
                DefaultReverseInd      = currentTrayportMapping.IsDefault,
                StartDate = currentTrayportMapping.Validity.Start,
                EndDate   = currentTrayportMapping.Validity.Finish.AddDays(2)
            };

            content = HttpContentExtensions.CreateDataContract(mapping);
            client  = new HttpClient();
        }
 protected static void Because_of()
 {
     entity = CounterpartyData.CreateBasicEntity();
     client.DefaultHeaders.Add("If-Match", entity.Version.ToString());
     response = client.Post(ServiceUrl["Counterparty"] + entity.Id, content);
 }
 protected static void Establish_context()
 {
     counterparty = CounterpartyData.CreateEntityWithTwoDetailsAndTwoMappings();
 }
Example #15
0
 protected static void Establish_context()
 {
     counterparty = CounterpartyData.CreateBasicEntity();
 }