Пример #1
0
        public void PriceProblem_Should_Calculate_TotalPrice()
        {
            // Given
            var phones = new APhone[]
            {
                new MobilePhone {
                    Price = 100m
                },
                new RadioPhone {
                    Price = 150m
                }
            };

            // When
            var solution = PriceProblem.Solve(phones);

            // Then
            solution.TotalPrice.Should().Be(250m);
        }
Пример #2
0
        public void PriceProblem_Should_Sort_By_Price()
        {
            // Given
            var phones = new APhone[]
            {
                new RadioPhone {
                    Price = 280m
                },
                new MobilePhone {
                    Price = 100m
                },
                new RadioPhone {
                    Price = 150m
                }
            };

            // When
            var solution = PriceProblem.Solve(phones);

            // Then
            solution.PhonesSortedByPrice.Should().BeInAscendingOrder(p => p.Price);
        }