public void EqualityMapped(bool mapped) { var configA = new SubscriptionDataConfig(typeof(TradeBar), Symbols.SPY, Resolution.Minute, TimeZones.NewYork, TimeZones.NewYork, false, false, false); var configB = new SubscriptionDataConfig(configA, mappedConfig: mapped); if (mapped) { Assert.AreNotEqual(configA, configB); Assert.AreNotEqual(configA.GetHashCode(), configB.GetHashCode()); } else { Assert.AreEqual(configA, configB); Assert.AreEqual(configA.GetHashCode(), configB.GetHashCode()); } }
public void NotEqualsMappingAndOffset(int offsetA, int offsetB, DataMappingMode mappingModeA, DataMappingMode mappingModeB) { var configA = new SubscriptionDataConfig(typeof(TradeBar), Symbols.SPY, Resolution.Minute, TimeZones.NewYork, TimeZones.NewYork, false, false, false, dataMappingMode: mappingModeA, contractDepthOffset: (uint)offsetA); var configB = new SubscriptionDataConfig(configA, dataMappingMode: mappingModeB, contractDepthOffset: (uint)offsetB); Assert.AreNotEqual(configA, configB); Assert.AreNotEqual(configA.GetHashCode(), configB.GetHashCode()); }
/// <summary> /// Serves as a hash function for a particular type. /// </summary> /// <returns> /// A hash code for the current <see cref="T:System.Object"/>. /// </returns> /// <filterpriority>2</filterpriority> public override int GetHashCode() { return(Configuration.GetHashCode()); }