public void Verify_Rebalance_SupportedSignalType__DoesNotThrow(SignalType signalType)
        {
            Signal signal = new Signal()
            {
                Stock = null, Direction = PositionDir.Long, Type = signalType, Rebalance = true, NewBalance = new List <(StockDefinition stockDef, float balance)>()
            };

            SignalVerifier.Verify(signal);
        }
        public void Verify_Rebalance_UnsupportedSignalType__Throws(SignalType signalType)
        {
            Signal signal = new Signal()
            {
                Stock = null, Type = signalType, Rebalance = true, NewBalance = new List <(StockDefinition stockDef, float balance)>()
            };

            Should.Throw <Exception>(() => SignalVerifier.Verify(signal));
        }
        public void Verify_Rebalance_NullNewBalanceList__Throws()
        {
            Signal signal = new Signal()
            {
                Stock = null, Rebalance = true, NewBalance = null
            };

            Should.Throw <Exception>(() => SignalVerifier.Verify(signal));
        }
        public void Verify_Signal_NotNullStock_NonZeroVolume__DoesNotThrow()
        {
            Signal signal = new Signal()
            {
                Stock = _stock, Volume = 1
            };

            SignalVerifier.Verify(signal);
        }
        public void Verify_Signal_ZeroVolume__Throws()
        {
            Signal signal = new Signal()
            {
                Stock = _stock, Volume = 0
            };

            Should.Throw <Exception>(() => SignalVerifier.Verify(signal));
        }
        public void Verify_Signal_NullStock__Throws()
        {
            Signal signal = new Signal()
            {
                Stock = null
            };

            Should.Throw <Exception>(() => SignalVerifier.Verify(signal));
        }
        public void Verify_Rebalance_NewBAlanceGreaterThan1__Throws()
        {
            Signal signal = new Signal()
            {
                Stock      = null,
                Rebalance  = true,
                NewBalance = new List <(StockDefinition stockDef, float balance)>()
                {
                    (_stock, 0.4f),
                    (_stock, 0.3f),
                    (_stock, 0.5f),
                }
            };

            Should.Throw <Exception>(() => SignalVerifier.Verify(signal));
        }
    }