Пример #1
0
        private static SpyActor SetupWatcher(out PeopleManager peopleManager)
        {
            var peopleCollection = PeopleManagerTests.SetupPeopleCollection();
            var spyActor         = new SpyActor();

            peopleManager = new PeopleManager("test")
            {
                People = peopleCollection
            };
            var watcher = new CollectionWatcher <Person>(peopleManager.People, spyActor);

            return(spyActor);
        }
Пример #2
0
        public void WatcherTakesInCollection()
        {
            var peopleCollection = PeopleManagerTests.SetupPeopleCollection();
            var spyActor         = new SpyActor();
            var peopleManager    = new PeopleManager("test")
            {
                People = peopleCollection
            };
            var watcher = new CollectionWatcher <Person>(peopleManager.People, spyActor);
            var want    = PeopleManagerTests.SetupPeopleCollection();

            for (var i = 0; i < want.Count; i++)
            {
                Assert.Equal(want[i], watcher.Collection[i]);
            }
        }