예제 #1
0
        public void Add_ViewModel_AddModelBeforeNotify()
        {
            // Arrange
            Utils.PlayerDummy m             = new Utils.PlayerDummy();
            Utils.PlayerDummy modelNotified = null;
            CollectionViewModel <Utils.PlayerDummy, DummyPlayerVM> collection = new CollectionViewModel <Utils.PlayerDummy, DummyPlayerVM> ();

            collection.GetNotifyCollection().CollectionChanged += (sender, e) => modelNotified = ((DummyPlayerVM)e.NewItems [0]).Model;

            // Act
            collection.ViewModels.Add(new DummyPlayerVM {
                Model = m
            });

            // Assert
            Assert.AreEqual(m, modelNotified);
        }