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); }
public Instrument(long agahId, long tsetId, string isin, string symbol, string companyName) { _isin = new Isin(isin); _agahId = agahId; _tsetId = tsetId; _symbol = symbol; _companyName = companyName; }
public void ValidateIsinToStringMethod(string input) { string expectedValue = input; string actualValue = new Isin(input).ToString(); actualValue.Should().Be(expectedValue); }
partial void OnIsinChanged() { var trimmedValue = Isin.TrimOrNull(); if (trimmedValue != Isin) { Isin = trimmedValue; } }
/// <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();
public override int GetHashCode() { return(Isin.GetHashCode()); }