Пример #1
0
        public void ShouldPickCorrectSizeParcel(int x, int y, int z, int weight, string expectedType)
        {
            var input = new ParcelInput(x, y, z, weight);

            var parcelType = new ParcelPicker(ParcelTestData.ParcelTypes).Pick(input);

            Assert.Equal(expectedType, parcelType.Name);
        }
Пример #2
0
        public void ParcelTypesShouldBeOrderedByPrice()
        {
            var input = new ParcelInput(5, 0, 0, 0);
            var types = new[]
            {
                new ParcelSpecification("Small $2", 10, 0, 2, 0),
                new ParcelSpecification("Small $1", 10, 0, 1, 0)
            };

            var parcelType = new ParcelPicker(types).Pick(input);

            Assert.Equal("Small $1", parcelType.Name);
        }