コード例 #1
0
        public void ShippingCostMustBePositiveAndNonZero()
        {
            var strategy = new WorldWideShippingStrategy(12);

            strategy.CalculateShippingCost(1f, ValidDimensions, RegionInfo.CurrentRegion)
            .Should().BeGreaterThan(0m);
        }
コード例 #2
0
        public void ShippingDomesticallyIsFree()
        {
            var strategy = new WorldWideShippingStrategy(12);

            strategy.CalculateShippingCost(1f, ValidDimensions, RegionInfo.CurrentRegion)
            .Should().Be(decimal.Zero);
        }
コード例 #3
0
        public void ShippingFlatRateCanBeCHanged()
        {
            var strategy = new WorldWideShippingStrategy(12);

            strategy.FlatRate = decimal.MinusOne;
            strategy.FlatRate.Should().Be(decimal.MinusOne);

            strategy.CalculateShippingCost(1f, ValidDimensions, RegionInfo.CurrentRegion)
            .Should().BeGreaterThan(0m);
        }
コード例 #4
0
        public void WorldWideShippingStrategyTest()
        {
            decimal ret = _strategy.CalculateShippingCost(1f, _validDimentions, null);

            Assert.Equals(ret, decimal.Zero);
        }