Exemple #1
0
 public Cart(int userId)
 {
     InitializeComponent();
     vm = new CartViewModel();
     vm.FetcyByUserAsync(userId);
     _total               = vm.TotalPrice(userId);
     BindingContext       = vm;
     this.totalPrice.Text = "Total price: $ " + _total;
 }
Exemple #2
0
        public void CartViewModels_TotalPrice_Returns_CorrectValues()
        {
            //Arrange
            CartViewModel cartViewModel      = _cartViewModel;
            int           expectedTotalPrice = 55;

            //Act
            decimal actualTotalPrice = _cartViewModel.TotalPrice();

            //Assert
            Assert.Equal(expectedTotalPrice, actualTotalPrice);
        }