Ejemplo n.º 1
0
        public void TestConvertingPrices()
        {
            List <OfficePacks> officePacks = new List <OfficePacks>();

            officePacks.Add(
                new OfficePacks()
            {
                name        = "test1",
                vendor      = "test1",
                composition = 1,
                price       = 9000
            });
            officePacks.Add(
                new OfficePacks()
            {
                name        = "test2",
                vendor      = "test2",
                composition = 3,
                price       = 5000
            });
            officePacks.Add(
                new OfficePacks()
            {
                name        = "test3",
                vendor      = "test3",
                composition = 5,
                price       = 8000
            });
            officePacks.Add(
                new OfficePacks()
            {
                name        = "test4",
                vendor      = "test4",
                composition = 10,
                price       = 4000
            });

            Assert.AreEqual((int)Math.Floor(officePacks[0].price * OfficePacksMethodConvertUSD.GetRUBUSDRate()), OfficePacksMethodConvertUSD.ConvertPricesToUsd(officePacks)[0].price);
        }
Ejemplo n.º 2
0
 public void TestBrokenApi()
 {
     Assert.ThrowsException <BrokenApiException>(() => OfficePacksMethodConvertUSD.GetRUBUSDRate());
 }