Exemplo n.º 1
0
        public void Strength_Buy100Sell0_ReturnsBuy25()
        {
            var combinedSignal = new OffensiveCombinedSignal( new BuySignal( 100 ), new SellSignal( 0 ) );

            var expectedSignal = new BuySignal( 25 );
            Assert.That( combinedSignal, Is.EqualTo( expectedSignal ) );
        }
Exemplo n.º 2
0
        public void Strength_Buy100Neutral50_ReturnsBuy25()
        {
            var combinedSignal = new DefensiveCombinedSignal( new BuySignal( 100 ), new NeutralSignal( 50 ) );

            var expectedSignal = new BuySignal( 25 );
            Assert.That( combinedSignal, Is.EqualTo( expectedSignal ) );
        }
Exemplo n.º 3
0
        public void Equals_WithSimilarSignal_ReturnsTrue()
        {
            var signal1 = new BuySignal( 4, 7 );
            var signal2 = new BuySignal( 4, 7 );

            Assert.IsTrue( signal1.Equals( signal2 ) );
        }
Exemplo n.º 4
0
        public void Equals_WithDifferentSignal_ReturnsFalse()
        {
            var signal1 = new BuySignal( 4, 7 );
            var signal2 = new BuySignal( 4, 8 );

            Assert.IsFalse( signal1.Equals( signal2 ) );
        }
Exemplo n.º 5
0
        public void Weigth_WhenCalled_SignalWithAdjustedStrengthIsReturned()
        {
            var signal = new BuySignal( 4 );

            var weightedSignal = signal.Weight( 0.5 );

            Assert.That( weightedSignal.Strength.Value, Is.EqualTo( 2 ) );
        }
Exemplo n.º 6
0
        public void BuySignal_WhenCreated_StrengthIs50()
        {
            var signal = new BuySignal();

            Assert.That( signal.Strength.Value, Is.EqualTo( 50 ) );
        }
Exemplo n.º 7
0
        public void Ctor_WithoutQuality_QualitySetTo100Percent()
        {
            var signal = new BuySignal( 45 );

            Assert.That( signal.Quality, Is.EqualTo( Percentage.Hundred ) );
        }