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 Establish_context()
        {
            client = new HttpClient();
            entity = ExchangeData.CreateBasicEntity();

            content      = HttpContentExtensions.CreateDataContract(new EnergyTrading.MDM.Contracts.Sample.Exchange());
            startVersion = CurrentEntityVersion();
        }
        protected static void Establish_context()
        {
            client = new HttpClient();
            entity = ExchangeData.CreateBasicEntity();

            content = HttpContentExtensions.CreateDataContract(new EnergyTrading.MDM.Contracts.Sample.Exchange());
            startVersion = CurrentEntityVersion();
        }
 protected static void Establish_context()
 {
     entity = ExchangeData.CreateBasicEntityWithOneMapping();
     client = new HttpClient();
     var notAMapping = new MDM.Exchange();
     content = HttpContentExtensions.CreateDataContract(notAMapping);
     startVersion = CurrentEntityVersion();
 }
Ejemplo n.º 5
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 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));
        }
        protected static void Establish_context()
        {
            entity = ExchangeData.CreateBasicEntityWithOneMapping();
            client = new HttpClient();
            var notAMapping = new MDM.Exchange();

            content      = HttpContentExtensions.CreateDataContract(notAMapping);
            startVersion = CurrentEntityVersion();
        }
Ejemplo n.º 8
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));
        }
        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>();
        }
Ejemplo n.º 10
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()
        {
            entity1 = ExchangeData.CreateBasicEntity();
            entity2 = ExchangeData.CreateBasicEntity();

            client = new HttpClient();

            var search = new Search();
            ExchangeData.CreateSearch(search, entity1, entity2);

            content = HttpContentExtensions.CreateDataContract(search);
        }
        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);
        }
Ejemplo n.º 13
0
        protected static void Establish_context()
        {
            entity1 = ExchangeData.CreateBasicEntity();
            entity2 = ExchangeData.CreateBasicEntity();

            client = new HttpClient();

            var search = new Search();

            ExchangeData.CreateSearch(search, entity1, entity2);

            content = HttpContentExtensions.CreateDataContract(search);
        }
        public void Map_NoConditions_MapsPartyIdToPartyName()
        {
            //Arrange
            var source = new MDM.Exchange() { Party = new Party() { Id = 999 } };
            source.Party.AddDetails(new PartyDetails(){ Name = "999" });
            var mapper = new ExchangeMapper();

            //Act
            var destination = mapper.Map(source);

            //Assert
            Assert.AreEqual("999", destination.Party.Name);
        }
Ejemplo n.º 15
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);
        }
Ejemplo n.º 16
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();
        }
        protected static void Establish_context()
        {
            entity = ExchangeData.CreateBasicEntity();
            mapping = new EnergyTrading.Mdm.Contracts.Mapping{
                    SystemName = "Endur",
                    Identifier = "Test",
                    SourceSystemOriginated = false,
                    DefaultReverseInd = true,
                    StartDate = Script.baseDate,
                    EndDate = Script.baseDate.AddDays(2)
                };

            content = HttpContentExtensions.CreateDataContract(mapping);
            content2 = HttpContentExtensions.CreateDataContract(mapping);
            client = new HttpClient();
        }
Ejemplo n.º 18
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();
        }
Ejemplo n.º 19
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();
        }
        public void Map_NoConditions_MapsPartyIdToPartyName()
        {
            //Arrange
            var source = new MDM.Exchange()
            {
                Party = new Party()
                {
                    Id = 999
                }
            };

            source.Party.AddDetails(new PartyDetails()
            {
                Name = "999"
            });
            var mapper = new ExchangeMapper();

            //Act
            var destination = mapper.Map(source);

            //Assert
            Assert.AreEqual("999", destination.Party.Name);
        }
        public static void CompareContractWithEntityDetails(EnergyTrading.MDM.Contracts.Sample.Exchange contract, MDM.Exchange entity)
        {
            MDM.ExchangeDetails correctDetail = null;

            if (entity.Details.Count == 1)
            {
                correctDetail = entity.Details[0] as MDM.ExchangeDetails;
            }
            else
            {
                correctDetail = (MDM.ExchangeDetails)entity.Details.Where(
                    x => x.Validity.Start >= contract.MdmSystemData.StartDate && x.Validity.Finish >= contract.MdmSystemData.EndDate).First();
            }

            Assert.AreEqual(contract.Details.Name, correctDetail.Name);
            Assert.AreEqual(contract.Details.Phone, correctDetail.Phone);
            Assert.AreEqual(contract.Details.Fax, correctDetail.Fax);
            Assert.AreEqual(contract.Party.MdmId(), entity.Party.Id);
        }
 protected static void Because_of()
 {
     entity = ExchangeData.CreateBasicEntity();
     client.DefaultHeaders.Add("If-Match", entity.Version.ToString());
     response = client.Post(ServiceUrl["Exchange"] + entity.Id, content);
 }
 protected static void Establish_context()
 {
     exchange = ExchangeData.CreateEntityWithTwoDetailsAndTwoMappings();
 }
Ejemplo n.º 24
0
 protected static void Establish_context()
 {
     entity1 = ExchangeData.CreateBasicEntity();
     entity2 = ExchangeData.CreateBasicEntity();
 }
 protected static void Because_of()
 {
     entity = ExchangeData.CreateBasicEntity();
     client.DefaultHeaders.Add("If-Match", entity.Version.ToString());
     response = client.Post(ServiceUrl["Exchange"] + entity.Id, content);
 }
 protected static void Establish_context()
 {
     exchange = ExchangeData.CreateBasicEntity();
 }
Ejemplo n.º 27
0
 protected static void Establish_context()
 {
     exchange = ExchangeData.CreateEntityWithTwoDetailsAndTwoMappings();
 }