Ejemplo n.º 1
0
        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());
        }
Ejemplo n.º 2
0
        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));
        }
Ejemplo n.º 3
0
        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));
        }
Ejemplo n.º 4
0
        public void Equals_ShouldReturnFalse_WhenTypeDifferent()
        {
            var query = new TestQuery(symbolId: 1, functionType: QueryFunctionType.SingleQuote);

            Assert.False(query.Equals(new { SymbolId = 1, FunctionType = QueryFunctionType.SingleQuote }));
        }