Beispiel #1
0
 public void ReturnsCorrectResult(
     decimal closingPrice,
     decimal fastSMA,
     decimal slowSMA,
     TAZ expectedResult)
 {
     Assert.AreEqual(expectedResult, Service.GetTAZ(closingPrice, fastSMA, slowSMA));
 }
Beispiel #2
0
        public TechnicalAnalysisBuilder SetTAZ(string value)
        {
            if (Enum.TryParse <TAZ>(value, true, out var result))
            {
                _taz = result;
            }

            return(this);
        }
Beispiel #3
0
        public override int GetHashCode()
        {
            var hashCode = 1276244321;

            hashCode = hashCode * -1521134295 + FastSMA.GetHashCode();
            hashCode = hashCode * -1521134295 + SlowSMA.GetHashCode();
            hashCode = hashCode * -1521134295 + TAZ.GetHashCode();
            hashCode = hashCode * -1521134295 + Trend.GetHashCode();
            return(hashCode);
        }
Beispiel #4
0
        public TechnicalAnalysisBuilder SetTAZ(TAZ value)
        {
            _taz = value;

            return(this);
        }
        public void ShouldReturnValidObject_WhenValidInput(decimal fastSMA, decimal slowSMA, TAZ taz, Trend trend)
        {
            var result = new TechnicalAnalysisBuilder()
                         .SetFastSMA(fastSMA)
                         .SetSlowSMA(slowSMA)
                         .SetTAZ(taz.ToString())
                         .SetTrend(trend.ToString())
                         .Build();

            result.Should().NotBeNull();
            result.FastSMA.Should().Be(fastSMA);
            result.SlowSMA.Should().Be(slowSMA);
            result.TAZ.Should().Be(taz);
            result.Trend.Should().Be(trend);
        }