Ejemplo n.º 1
0
 public void EmptySequence_ReturnsAllZeros(
     int[] sequence, 
     SequanceAnalyzer sut)
 {
     var actual = sut.Analyze(sequence);
     actual.Should().Be(new SequenceAnalysisResult());
 }
Ejemplo n.º 2
0
 public void AtomicSequence_ReturnsAllSameValues(
     int[] sequence,
     SequenceAnalysisResult expected,
     SequanceAnalyzer sut)
 {
     var actual = sut.Analyze(sequence);
     actual.Should().Be(expected);
 }
Ejemplo n.º 3
0
        public void PredefinedSequence_ReturnsCorrectResult(
            int[] sequence,
            SequanceAnalyzer sut)
        {
            var actual = sut.Analyze(sequence);

            var expectedAvarage = sequence.Sum() / 6.0;

            var expected = new SequenceAnalysisResult{
                                    MinValue = -2,
                                    MaxValue = 92,
                                    SequenceLength = 6,
                                    AvarageValue = expectedAvarage};

            actual.ShouldBeEquivalentTo(expected);
        }