Beispiel #1
0
        private static bool AreEqual(IReadOnlyCollection <AssetIndexInvestment> left,
                                     IReadOnlyCollection <AssetIndexInvestment> right)
        {
            if (left.Count != right.Count)
            {
                return(false);
            }

            foreach (AssetIndexInvestment leftAssetIndexInvestment in left)
            {
                AssetIndexInvestment rightAssetIndexInvestment =
                    right.SingleOrDefault(o => o.Name == leftAssetIndexInvestment.Name);

                if (rightAssetIndexInvestment == null)
                {
                    return(false);
                }

                if (!AreEqual(leftAssetIndexInvestment, rightAssetIndexInvestment))
                {
                    return(false);
                }
            }

            return(true);
        }
Beispiel #2
0
 private static bool AreEqual(AssetIndexInvestment left, AssetIndexInvestment right)
 {
     return(left.Name == right.Name &&
            left.Value == right.Value &&
            left.Price == right.Price &&
            left.OpenVolume == right.OpenVolume &&
            left.OppositeVolume == right.OppositeVolume &&
            left.Weight == right.Weight &&
            left.Amount == right.Amount);
 }