public void CantGetMissing()
 {
     using (FinancialClient financialClient = Context.CreateFinancialClient())
     {
         InterpolatedYieldCurveDefinitionMaster interpolatedYieldCurveDefinitionMaster = financialClient.InterpolatedYieldCurveDefinitionMaster;
         Assert.Throws <DataNotFoundException>(() => interpolatedYieldCurveDefinitionMaster.Get(UniqueId.Create("InMemoryInterpolatedYieldCurveDefinition", long.MaxValue.ToString())));
     }
 }
        public void CanAddAndRemove()
        {
            using (FinancialClient financialClient = Context.CreateFinancialClient())
            {
                InterpolatedYieldCurveDefinitionMaster interpolatedYieldCurveDefinitionMaster = financialClient.InterpolatedYieldCurveDefinitionMaster;

                YieldCurveDefinitionDocument yieldCurveDefinitionDocument = GenerateDocument();

                AssertRoundTrip(interpolatedYieldCurveDefinitionMaster, yieldCurveDefinitionDocument);
                interpolatedYieldCurveDefinitionMaster.Remove(yieldCurveDefinitionDocument.UniqueId);

                Assert.Throws <DataNotFoundException>(() => interpolatedYieldCurveDefinitionMaster.Get(yieldCurveDefinitionDocument.UniqueId));
            }
        }
        private static void AssertRoundTrip(InterpolatedYieldCurveDefinitionMaster interpolatedYieldCurveDefinitionMaster, YieldCurveDefinitionDocument yieldCurveDefinitionDocument)
        {
            interpolatedYieldCurveDefinitionMaster.Add(yieldCurveDefinitionDocument);

            YieldCurveDefinitionDocument roundtrippedDoc = interpolatedYieldCurveDefinitionMaster.Get(yieldCurveDefinitionDocument.UniqueId);

            YieldCurveDefinition roundTripped = roundtrippedDoc.YieldCurveDefinition;

            var yieldCurveDefinition = yieldCurveDefinitionDocument.YieldCurveDefinition;

            Assert.Equal(yieldCurveDefinition.Name, roundTripped.Name);
            Assert.Equal(yieldCurveDefinition.InterpolatorName, roundTripped.InterpolatorName);
            Assert.Equal(yieldCurveDefinition.Currency, roundTripped.Currency);
            Assert.Equal(roundTripped.Region, roundTripped.Region);

            Assert.True(roundTripped.Strips.SequenceEqual(roundTripped.Strips));
        }