Exemple #1
0
        public void ValidationTest()
        {
            API                 API              = new API();
            Product             product          = new Product();
            AddProductViewModel productViewModel = new AddProductViewModel(product, API);

            productViewModel.ProductName = "";
            productViewModel.AddProductImplementationWithoutClose();
            Assert.IsNull(API.NewProduct);
            productViewModel.ProductName = "test";
            productViewModel.AddProductImplementationWithoutClose();
            Assert.IsNotNull(API.NewProduct);
        }
Exemple #2
0
        public void Update()
        {
            API                 API              = new API();
            Product             product          = new Product();
            AddProductViewModel productViewModel = new AddProductViewModel(product, API);

            productViewModel.ProductName = "test";
            productViewModel.AddProductImplementationWithoutClose();
            Assert.IsNotNull(API.NewProduct);
            productViewModel.ProductName = "testowo";
            productViewModel.UpdateProductImplementationWithoutClose();
            Assert.AreEqual(API.NewProduct.Name, "testowo");
        }