public Cart(int userId) { InitializeComponent(); vm = new CartViewModel(); vm.FetcyByUserAsync(userId); _total = vm.TotalPrice(userId); BindingContext = vm; this.totalPrice.Text = "Total price: $ " + _total; }
public void CartViewModels_TotalPrice_Returns_CorrectValues() { //Arrange CartViewModel cartViewModel = _cartViewModel; int expectedTotalPrice = 55; //Act decimal actualTotalPrice = _cartViewModel.TotalPrice(); //Assert Assert.Equal(expectedTotalPrice, actualTotalPrice); }