Ejemplo n.º 1
0
        protected static void Establish_context()
        {
            broker = BrokerData.CreateContractForEntityCreation();

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

            content      = HttpContentExtensions.CreateDataContract(new EnergyTrading.MDM.Contracts.Sample.Broker());
            startVersion = CurrentEntityVersion();
        }
        protected static void Because_of()
        {
            var entity = BrokerData.CreateBasicEntityWithOneMapping();

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

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

            content = HttpContentExtensions.CreateDataContract(notAMapping);
            client  = new HttpClient();
        }
        protected static void Establish_context()
        {
            entity = BrokerData.CreateBasicEntityWithOneMapping();
            client = new HttpClient();
            var notAMapping = new MDM.Broker();

            content      = HttpContentExtensions.CreateDataContract(notAMapping);
            startVersion = CurrentEntityVersion();
        }
Ejemplo n.º 6
0
        protected static void Establish_context()
        {
            client = new HttpClient();
            entity = BrokerData.CreateBasicEntity();
            var getResponse = client.Get(ServiceUrl["Broker"] + entity.Id);

            updatedContract = getResponse.Content.ReadAsDataContract <EnergyTrading.MDM.Contracts.Sample.Broker>();
            content         = HttpContentExtensions.CreateDataContract(BrokerData.MakeChangeToContract(updatedContract));
        }
Ejemplo n.º 7
0
        protected static void Because_of()
        {
            entity  = BrokerData.CreateBasicEntityWithOneMapping();
            mapping = entity.Mappings[0];
            client  = new HttpClient(ServiceUrl["Broker"] + string.Format("{0}/mapping/{1}", entity.Id, mapping.Id));

            response        = client.Get();
            mappingResponse = response.Content.ReadAsDataContract <EnergyTrading.Mdm.Contracts.MappingResponse>();
        }
Ejemplo n.º 8
0
        protected static void Because_of()
        {
            entity = BrokerData.CreateEntityWithTwoDetailsAndTwoMappings();

            client = new HttpClient(ServiceUrl["Broker"] +
                                    "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 = BrokerData.CreateBasicEntity();
            entity2 = BrokerData.CreateBasicEntity();

            client = new HttpClient();

            var search = new Search();

            BrokerData.CreateSearch(search, entity1, entity2);

            content = HttpContentExtensions.CreateDataContract(search);
        }
        protected static void Establish_context()
        {
            entity1 = BrokerData.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);
        }
Ejemplo n.º 11
0
        protected static void Establish_context()
        {
            entity  = BrokerData.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();
        }
Ejemplo n.º 12
0
        protected static void Establish_context()
        {
            entity = BrokerData.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();
        }
Ejemplo n.º 13
0
 protected static void Establish_context()
 {
     broker = BrokerData.CreateEntityWithTwoDetailsAndTwoMappings();
 }
Ejemplo n.º 14
0
 protected static void Because_of()
 {
     entity = BrokerData.CreateBasicEntity();
     client.DefaultHeaders.Add("If-Match", entity.Version.ToString());
     response = client.Post(ServiceUrl["Broker"] + entity.Id, content);
 }
Ejemplo n.º 15
0
 protected static void Establish_context()
 {
     entity1 = BrokerData.CreateBasicEntity();
     entity2 = BrokerData.CreateBasicEntity();
 }