public IEnumerable <ValidationError> Validate(FeedItem feeditem)
        {
            if (feeditem.GetType() != typeof(DeltaOneFeed))
            {
                throw new Exception("Incorrect type detected");
            }

            if (feeditem.CounterpartyId == default(int))
            {
                _validationerror.Add(new ValidationError(((DeltaOneFeed)feeditem).FeedItemId, "CounterpartyId is empty!"));
            }

            if (feeditem.PrincipalId == default(int))
            {
                _validationerror.Add(new ValidationError(((DeltaOneFeed)feeditem).FeedItemId, "PrincipalId is empty!"));
            }

            if (((DeltaOneFeed)feeditem).Isin == default(int))
            {
                _validationerror.Add(new ValidationError(((DeltaOneFeed)feeditem).FeedItemId, "Isin is empty!"));
            }

            if (((DeltaOneFeed)feeditem).MaturityDate == default(DateTime))
            {
                _validationerror.Add(new ValidationError(((DeltaOneFeed)feeditem).FeedItemId, "MaturityDate is empty!"));
            }

            return(_validationerror);
        }
Example #2
0
        public IEnumerable <ValidationError> Validate(FeedItem feeditem)
        {
            if (feeditem.GetType() != typeof(EmFeed))
            {
                throw new Exception("Incorrect type detected");
            }

            if (feeditem.SourceAccountId == default(int))
            {
                _validationerror.Add(new ValidationError(((EmFeed)feeditem).FeedItemId, "SourceAccountId is empty!"));
            }

            if (((EmFeed)feeditem).Sedol == default(string))
            {
                _validationerror.Add(new ValidationError(((EmFeed)feeditem).FeedItemId, "Sedol is empty!"));
            }

            if (((EmFeed)feeditem).AssetValue == default(int))
            {
                _validationerror.Add(new ValidationError(((EmFeed)feeditem).FeedItemId, "AssetValue is empty!"));
            }

            return(_validationerror);
        }