Пример #1
0
 public void TestListInUSDollars()
 {
     //Act
     Assert.AreEqual(_lawnmowerService.ListInUSDollars().Count, 3, "Should bet 3 items");
     Assert.AreEqual(_lawnmowerService.ListInUSDollars().First().Type, "Lawnmower", "Type should be Lawnmower");
     Assert.AreEqual(_lawnmowerService.ListInUSDollars().First().Price, _lawnmowerService.List().First().Price * 0.76, "US Rate should be applied");
 }
Пример #2
0
 public void TestListInUSDollars()
 {
     //Act
     Assert.AreEqual(_tShirtService.ListInUSDollars().Count, 3, "Should bet 3 items");
     Assert.AreEqual(_tShirtService.ListInUSDollars().First().Type, "TShirt", "Type should be TShirt");
     Assert.AreEqual(_tShirtService.ListInUSDollars().First().Price, _tShirtService.List().First().Price * 0.76, "US Rate should be applied");
 }
Пример #3
0
 public void TestListInUSDollars()
 {
     //Act
     Assert.AreEqual(_phoneCaseService.ListInUSDollars().Count, 2, "Should bet 2 items");
     Assert.AreEqual(_phoneCaseService.ListInUSDollars().First().Type, "Phone Case", "Type should be Phone Case");
     Assert.AreEqual(_phoneCaseService.ListInUSDollars().First().Price, _phoneCaseService.List().First().Price * 0.76, "US Rate should be applied");
 }
Пример #4
0
        public void TestListInUSDollars()
        {
            //Act
            Assert.AreEqual(_productService.List().Count, 8, "Should bet 8 items");
            Assert.AreEqual(_productService.List().Count(i => i.Type == "Lawnmower"), 3, "Should have 3 Lawnmower");
            Assert.AreEqual(_productService.List().Count(i => i.Type == "Phone Case"), 2, "Should have 2 Phone Case");
            Assert.AreEqual(_productService.List().Count(i => i.Type == "TShirt"), 3, "Should have 3 TShirts");

            var items            = _productService.List();
            var itemsInUSDollars = _productService.ListInUSDollars();

            for (int i = 0; i < itemsInUSDollars.Count; i++)
            {
                Assert.AreEqual(itemsInUSDollars[i].Price, items[i].Price * 0.76, "US Rate should be applied");
            }
        }