コード例 #1
0
ファイル: LogicTest.cs プロジェクト: TinkerGlass/tpr-zad1
        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);
        }
コード例 #2
0
ファイル: LogicTest.cs プロジェクト: TinkerGlass/tpr-zad1
        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);
        }