Exemplo n.º 1
0
        public override int GetHashCode()
        {
            int hash = 1;

            if (Isin.Length != 0)
            {
                hash ^= Isin.GetHashCode();
            }
            if (Currency.Length != 0)
            {
                hash ^= Currency.GetHashCode();
            }
            if (SecurityExchange.Length != 0)
            {
                hash ^= SecurityExchange.GetHashCode();
            }
            if (NoLevels != 0)
            {
                hash ^= NoLevels.GetHashCode();
            }
            if (_unknownFields != null)
            {
                hash ^= _unknownFields.GetHashCode();
            }
            return(hash);
        }
Exemplo n.º 2
0
 public Instrument(long agahId, long tsetId, string isin, string symbol, string companyName)
 {
     _isin        = new Isin(isin);
     _agahId      = agahId;
     _tsetId      = tsetId;
     _symbol      = symbol;
     _companyName = companyName;
 }
Exemplo n.º 3
0
        public void ValidateIsinToStringMethod(string input)
        {
            string expectedValue = input;

            string actualValue = new Isin(input).ToString();

            actualValue.Should().Be(expectedValue);
        }
Exemplo n.º 4
0
        partial void OnIsinChanged()
        {
            var trimmedValue = Isin.TrimOrNull();

            if (trimmedValue != Isin)
            {
                Isin = trimmedValue;
            }
        }
Exemplo n.º 5
0
        /// <summary>
        /// Returns a string that represents the current object.
        /// </summary>
        /// <returns>A string that represents the current object.</returns>
        public override string ToString()
        {
            var str = string.Empty;

            if (!Bloomberg.IsEmpty())
            {
                str += " Bloom {0}".Put(Bloomberg);
            }

            if (!Cusip.IsEmpty())
            {
                str += " CUSIP {0}".Put(Cusip);
            }

            if (!IQFeed.IsEmpty())
            {
                str += " IQFeed {0}".Put(IQFeed);
            }

            if (!Isin.IsEmpty())
            {
                str += " ISIN {0}".Put(Isin);
            }

            if (!Ric.IsEmpty())
            {
                str += " RIC {0}".Put(Ric);
            }

            if (!Sedol.IsEmpty())
            {
                str += " SEDOL {0}".Put(Sedol);
            }

            if (InteractiveBrokers != null)
            {
                str += " InteractiveBrokers {0}".Put(InteractiveBrokers);
            }

            if (!Plaza.IsEmpty())
            {
                str += " Plaza {0}".Put(Plaza);
            }

            return(str);
        }
 [TestCase("1AB23456789")]   // invalid first two char
 public void ShouldReturnFalse_WhenInputInvalid(string input) =>
 Isin.IsValidOrEmpty(input).Should().BeFalse();
 public void ShouldReturnTrue_WhenInputValid(string input) =>
 Isin.IsValidOrEmpty(input).Should().BeTrue();
Exemplo n.º 8
0
 public override int GetHashCode()
 {
     return(Isin.GetHashCode());
 }