Esempio n. 1
0
        public double getSellingPrice()
        {
            double summer = 0.0;

            if (azImporter.WholeSale == 0)
            {
                return(0.0);
            }

            double s = 0.0;

            ShippingList.TryGetValue(azImporter.Weight, out s);
            AzImporterPriceWeight = s;

            // EA Group Fee 20%

            summer = azImporter.WholeSale + (azImporter.WholeSale * 15) / 100;

            // profit 20% by default
            summer = summer + (azImporter.WholeSale * 20) / 100;

            // AzImporter Fee
            summer = summer + 2;

            // shipping
            summer = summer + AzImporterPriceWeight;

            // Amazon Fee 20%
            summer = summer + (summer * 18) / 100;

            return(summer);
        }
        public void PublicFieldTest()
        {
            ShippingList actual = new ShippingList();

            actual._shippingDate = new DateTime(2007, 9, 27);

            ShippingList expected = new ShippingList();

            expected._shippingDate = new DateTime(1978, 9, 27);

            AbstractConstraint sut = Property.AllPropertiesMatch(expected);

            Assert.False(sut.Eval(actual));
            Assert.Equal("Expected value of ShippingList._shippingDate is '09/27/1978 00:00:00', actual value is '09/27/2007 00:00:00'", sut.Message);
        }
        public void CollectionPropertyCountTest()
        {
            ShippingList actual = new ShippingList();

            actual.Products.Add(new Product("Ratched and Clank - Tools of Destruction", 61.05));

            ShippingList expected = new ShippingList();

            expected.Products.Add(new Product("Ratched and Clank - Tools of Destruction", 61.05));
            expected.Products.Add(new Product("Uncharted - Drake's Fortune", 69.99));

            AbstractConstraint sut = Property.AllPropertiesMatch(expected);

            Assert.False(sut.Eval(actual));
            Assert.Equal("expected number of items in collection ShippingList.Products is '2', actual is '1'", sut.Message);
        }
        public void CollectionPropertyTest()
        {
            ShippingList actual = new ShippingList();

            actual.Products.Add(new Product("Ratched and Clank - Tools of Destruction", 61.05));
            actual.Products.Add(new Product("Assassin's Creed", 69.99));

            ShippingList expected = new ShippingList();

            expected.Products.Add(new Product("Ratched and Clank - Tools of Destruction", 61.05));
            expected.Products.Add(new Product("Uncharted - Drake's Fortune", 69.99));

            AbstractConstraint sut = Property.AllPropertiesMatch(expected);

            Assert.False(sut.Eval(actual));
            Assert.Equal("Expected value of ShippingList.Products[1].Name is 'Uncharted - Drake's Fortune', actual value is 'Assassin's Creed'", sut.Message);
        }