Example #1
0
        public void ShippingRegionMustBeProvided()
        {
            var strategy = new  WorldWideShippingStrategy(12);

            //    mockDataAccess.Setup(m => m.CreateProduct(It.IsAny<Product>())).Returns(true);
            // var productBusiness = new ProductBusiness(mockDataAccess.Object);
            //   Moq<WorldWideShippingStrategy> strategy = new WorldWideShippingStrategy(12);
            strategy.Invoking(s =>
                              s.CalculateShippingCost(1f, new Size <float> {
                X = 2, Y = 4
            }, null))
            .Should()
            .Throw <ArgumentNullException>("Destination must be provided")
            .And.ParamName.Should().Be("destination");

            //strategy.CalculateShippingCost(1f,new Size<float> { X=1, Y=2 },null).ShouldThrow
        }