示例#1
0
        public MainForm(MainViewModel viewModel)
        {
            this.viewModel = viewModel;
            InitializeComponent();

            Bind();
            BindEvents();
        }
        public MainWindow()
        {
            viewModel = new MainViewModel(new PlainTextLogger());
            InitializeComponent();

            Bind();
            BindEvents();
        }
        public void LoadGameByName()
        {
            Arrange(a.Game(name: "Diablo III"));

            var viewModel = new MainViewModel(serviceFake);
            viewModel.Load("Diablo III");

            Assert.AreEqual("Diablo III", viewModel.CurrentGame.Name);
        }
示例#4
0
 //---------------------------------------------------------------------
 public MainWindow()
 {
     InitializeComponent();
     // this.ReadXml();
     //_ribbon.IsMinimized = true;
     mainViewModel = new MainViewModel();
     base.DataContext = mainViewModel;
     this._treeViewControl.DataContext = base.DataContext;
     this._orderGrid.DataContext = mainViewModel.CurrentOrder;
     this.CreateBindings();
 }
        public void AssertFakeState()
        {
            var mock = new Mock<ILifeWebService>();
            var expected = new Game();
            const string gameName = "New game";

            mock.Setup(_ => _.Load(gameName)).Returns(expected);

            var viewModel = new MainViewModel(mock.Object);
            viewModel.Load(gameName);

            Assert.AreSame(expected, viewModel.CurrentGame);
        }
 public void TestInitialize()
 {
     logger = new FakeLogger();
     viewModel = new MainViewModel(logger);
 }