예제 #1
0
        public void TestRemove_ShouldBehaveCorrectly()
        {
            // Arrange
            var tracker = new StockTracker();

            tracker.Add(2, 1);
            tracker.Remove(2);

            var expectedResult = 0;

            // Act
            var actual = tracker.Average;

            // Assert
            actual.Should().Be(expectedResult);
        }
예제 #2
0
        public void TestUpdate_ShouldUpdateCorrectly()
        {
            // Arrange
            var tracker = new StockTracker();

            tracker.Add(2, 1);
            tracker.Update(2, 5);

            var expectedResult = 5;

            // Act
            var actual = tracker.Average;

            // Assert
            actual.Should().Be(expectedResult);
        }
예제 #3
0
        public void TestMin_ShouldReturnCorrectly()
        {
            // Arrange
            var tracker = new StockTracker();

            tracker.Add(1, 2);
            tracker.Add(2, 1);
            tracker.Add(3, 3);

            var expectedResult = 1;

            // Act
            var actual = tracker.Min;

            // Assert
            actual.Should().Be(expectedResult);
        }