protected static void Establish_context() { client = new HttpClient(); var curve = new Contracts.Curve(); content = HttpContentExtensions.CreateDataContract(curve); }
public static Contracts.Curve CreateContractForEntityCreation() { var contract = new Contracts.Curve(); AddDetailsToContract(contract); return(contract); }
protected static void Establish_context() { entity = CurveData.CreateBasicEntity(); var notAMapping = new Contracts.Curve(); content = HttpContentExtensions.CreateDataContract(notAMapping); client = new HttpClient(); }
protected static void Because_of() { using (var client = new HttpClient(ServiceUrl["Curve"] + curve.Id)) { using (HttpResponseMessage response = client.Get()) { returnedCurve = response.Content.ReadAsDataContract<Contracts.Curve>(); } } }
public static void Compare(Contracts.Curve contract, MDM.Curve entity) { Assert.AreEqual(contract.Details.Name, entity.Name); Assert.AreEqual(contract.Details.Commodity.NexusId().Value, entity.Commodity.Id); Assert.AreEqual(contract.Details.Originator.NexusId().Value, entity.Originator.Id); Assert.AreEqual(contract.Details.Location.NexusId().Value, entity.Location.Id); Assert.AreEqual(contract.Details.CommodityUnit, entity.CommodityUnit); Assert.AreEqual(contract.Details.CurveType, entity.Type); Assert.AreEqual(contract.Details.DefaultSpread, entity.DefaultSpread); Assert.AreEqual(contract.Details.Currency, entity.Currency); }
protected static void Because_of() { asof = Script.baseDate.AddSeconds(1); client = new HttpClient(ServiceUrl["Curve"] + string.Format("{0}?as-of={1}", curve.Id.ToString(), asof.ToString(DateFormatString))); HttpResponseMessage response = client.Get(); returnedCurve = response.Content.ReadAsDataContract <Contracts.Curve>(); }
protected static void Because_of() { using (var client = new HttpClient(ServiceUrl["Curve"] + curve.Id)) { using (HttpResponseMessage response = client.Get()) { returnedCurve = response.Content.ReadAsDataContract <Contracts.Curve>(); } } }
private static void AddDetailsToContract(Contracts.Curve contract) { // TODO_IntegrationTestGeneration_Curve - Add details to a contract var curve = ObjectMother.Create <Curve>(); repository.Add(curve); repository.Flush(); contract.Details = new CurveDetails() { Name = curve.Name, Commodity = curve.Commodity.CreateNexusEntityId(() => curve.Commodity.Name), CommodityUnit = curve.CommodityUnit, Currency = curve.Currency, DefaultSpread = curve.DefaultSpread, Location = curve.Location.CreateNexusEntityId(() => curve.Location.Name), CurveType = curve.Type, Originator = curve.Originator.CreateNexusEntityId(() => curve.Originator.LatestDetails.Name), }; }
public static Contracts.Curve CreateContractForEntityCreation() { var contract = new Contracts.Curve(); AddDetailsToContract(contract); return contract; }
public static Contracts.Curve MakeChangeToContract(Contracts.Curve currentContract) { AddDetailsToContract(currentContract); currentContract.Nexus.StartDate = currentContract.Nexus.StartDate.Value.AddDays(2); return(currentContract); }
protected static void Because_of() { asof = Script.baseDate.AddSeconds(1); client = new HttpClient(ServiceUrl["Curve"] + string.Format("{0}?as-of={1}", curve.Id.ToString(), asof.ToString(DateFormatString))); HttpResponseMessage response = client.Get(); returnedCurve = response.Content.ReadAsDataContract<Contracts.Curve>(); }
public void should_not_return_a_curve() { Contracts.Curve returnedCurve = null; try { returnedCurve = response.Content.ReadAsDataContract <Contracts.Curve>(); } catch { } Assert.IsNull(returnedCurve); }