Esempio n. 1
0
        public void ShowAddWindowTest()
        {
            ProductListViewModel viewModel = new ProductListViewModel(new TestService());
            TestWindowResolver   resolver  = new TestWindowResolver();

            viewModel.WindowResolver = resolver;
            viewModel.DisplayAddWindow.Execute(null);
            Assert.AreEqual(resolver.Window.Showed, true);
            Assert.IsNotNull(resolver.Window.ViewModel);
            Assert.IsNotNull(((ProductDetailsViewModel)resolver.Window.ViewModel).Sizes);
        }
Esempio n. 2
0
        public void ShowWindowDetailsTest()
        {
            ProductListViewModel viewModel = new ProductListViewModel(new TestService());
            Product product = new Product();

            product.Name         = "name";
            product.ReorderPoint = 12;
            viewModel.Product    = product;
            TestWindowResolver resolver = new TestWindowResolver();

            viewModel.WindowResolver = resolver;
            viewModel.DisplayDetails.Execute(null);
            Assert.AreEqual(resolver.Window.Showed, true);
            Assert.AreEqual(((ProductDetailsViewModel)resolver.Window.ViewModel).ProductName, "name");
            Assert.AreEqual(((ProductDetailsViewModel)resolver.Window.ViewModel).ReorderPoint, 12);
        }