public async void Test4()
        {
            ViewParticularProduct viewProduct = new ViewParticularProduct();
            await viewProduct.GetAProductsByID("P101");

            var product = ViewParticularProduct.selectedProduct;

            Assert.NotNull(product);
        }
Exemplo n.º 2
0
        private async void ViewButton_Click(object sender, RoutedEventArgs e)
        {
            ViewParticularProduct product = new ViewParticularProduct();
            await product.GetAProductsByID(productIdSelected);

            Products          productSelected = ViewParticularProduct.selectedProduct;
            ProductViewWindow viewWindow      = new ProductViewWindow(productSelected);

            viewWindow.Show();
            this.Close();
        }
        public async void Test5()
        {
            ViewParticularProduct viewProduct = new ViewParticularProduct();
            await viewProduct.GetAProductsByID("P155");

            var      product               = ViewParticularProduct.selectedProduct;
            var      serializedProduct     = JsonConvert.SerializeObject(product);
            Products nullProduct           = new Products();
            var      serializedNullProduct = JsonConvert.SerializeObject(nullProduct);

            Assert.Equal(serializedNullProduct, serializedProduct);
        }