Example #1
0
        public MainWindow()
        {
            InitializeComponent();

            // neue Instanz des ViewModels erzeugen ...
            TheModel = new GreetingVm();

            // ... und diese dann ans UI "kleben"
            DataContext = TheModel;
        }
        public void GreetingChangesIfNameIsChanged()
        {
            // arrange
            var vm = new GreetingVm();

            // act
            vm.Name = "Jack";

            // assert
            Assert.AreEqual("Hello, Jack!", vm.Greeting);
        }
        public void InitialGreetingIsCorrect()
        {
            // arrange
            var vm = new GreetingVm();

            // act
            // (nothing to do, here)

            // assert
            Assert.AreEqual("Hello, world!", vm.Greeting);
        }