예제 #1
0
        protected static void Establish_context()
        {
            exchange = ExchangeData.CreateContractForEntityCreation();

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

            content      = HttpContentExtensions.CreateDataContract(new EnergyTrading.MDM.Contracts.Sample.Exchange());
            startVersion = CurrentEntityVersion();
        }
예제 #3
0
        protected static void Establish_context()
        {
            entity = ExchangeData.CreateBasicEntity();
            var notAMapping = new EnergyTrading.MDM.Contracts.Sample.Exchange();

            content = HttpContentExtensions.CreateDataContract(notAMapping);
            client  = new HttpClient();
        }
        protected static void Because_of()
        {
            var entity = ExchangeData.CreateBasicEntityWithOneMapping();

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

            response = client.Get();
        }
        protected static void Establish_context()
        {
            entity = ExchangeData.CreateBasicEntityWithOneMapping();
            client = new HttpClient();
            var notAMapping = new MDM.Exchange();

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

            response = client.Get();
            mappingResponse = response.Content.ReadAsDataContract<EnergyTrading.Mdm.Contracts.MappingResponse>();
        }
예제 #7
0
        protected static void Establish_context()
        {
            client = new HttpClient();
            entity = ExchangeData.CreateBasicEntity();
            var getResponse = client.Get(ServiceUrl["Exchange"] + entity.Id);

            updatedContract = getResponse.Content.ReadAsDataContract <EnergyTrading.MDM.Contracts.Sample.Exchange>();
            content         = HttpContentExtensions.CreateDataContract(ExchangeData.MakeChangeToContract(updatedContract));
        }
예제 #8
0
        protected static void Because_of()
        {
            entity = ExchangeData.CreateEntityWithTwoDetailsAndTwoMappings();

            client = new HttpClient(ServiceUrl["Exchange"] +
                                    "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()
        {
            var entity1 = ExchangeData.CreateBasicEntity();
            var entity2 = ExchangeData.CreateBasicEntity();

            client = new HttpClient();

            var search = new Search();

            ExchangeData.CreateSearch(search, entity1, entity2);

            content = HttpContentExtensions.CreateDataContract(search);
        }
예제 #10
0
        protected static void Establish_context()
        {
            entity1 = ExchangeData.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);
        }
예제 #11
0
        protected static void Establish_context()
        {
            entity  = ExchangeData.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();
        }
예제 #12
0
        protected static void Establish_context()
        {
            entity = ExchangeData.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();
        }
예제 #13
0
 protected static void Establish_context()
 {
     exchange = ExchangeData.CreateEntityWithTwoDetailsAndTwoMappings();
 }
 protected static void Because_of()
 {
     entity = ExchangeData.CreateBasicEntity();
     client.DefaultHeaders.Add("If-Match", entity.Version.ToString());
     response = client.Post(ServiceUrl["Exchange"] + entity.Id, content);
 }
예제 #15
0
 protected static void Establish_context()
 {
     entity1 = ExchangeData.CreateBasicEntity();
     entity2 = ExchangeData.CreateBasicEntity();
 }