public void GetHashCode_QueriesShouldReturnSameHashCode_WhenEqual(int otherQuerySymbolId, QueryFunctionType otherQueryFunctionType, bool expectedResult) { var query = new TestQuery(symbolId: 1, functionType: QueryFunctionType.SingleQuote); var query2 = new TestQuery(otherQuerySymbolId, otherQueryFunctionType); Assert.Equal(expectedResult, query.GetHashCode() == query2.GetHashCode()); }
public void Equals_ShouldReturnTrue_WhenSymbolAndFunctionTypeEqual(int otherQuerySymbolId, QueryFunctionType otherQueryFunctionType, bool expectedResult) { var query = new TestQuery(symbolId: 1, functionType: QueryFunctionType.SingleQuote); var query2 = new TestQuery(otherQuerySymbolId, otherQueryFunctionType); Assert.Equal(expectedResult, query.Equals(query2)); }
public void ShouldInstantiateWithDateAndSymbolAndFunctionType() { var symbolId = 1; var query = new TestQuery(symbolId, QueryFunctionType.SingleQuote); Assert.Equal(symbolId, query.SymbolId); Assert.Equal(QueryFunctionType.SingleQuote, query.FunctionType); Assert.True(query.CreateDate > default(DateTime)); }
public void Equals_ShouldReturnFalse_WhenTypeDifferent() { var query = new TestQuery(symbolId: 1, functionType: QueryFunctionType.SingleQuote); Assert.False(query.Equals(new { SymbolId = 1, FunctionType = QueryFunctionType.SingleQuote })); }