public void GravatarsViewModelConstructorTest()
        {
            var            gravatarService = new GravatarServiceMock();
            var            target          = new GravatarsViewModel(gravatarService);
            IList <object> list            = new[] { target.Persons.GetEnumerator() };

            Assert.AreEqual(2, list.Count);
            Assert.AreSame(gravatarService.Persons[0], list[0] as PersonMock);
            Assert.AreSame(gravatarService.Persons[1], list[1] as PersonMock);
        }
예제 #2
0
        public void GravatarsViewModelConstructorTest()
        {
            var            gravatarService  = new GravatarServiceMock();
            var            target           = new GravatarsViewModel(gravatarService);
            var            personEnumerator = target.Persons.GetEnumerator();
            IList <object> list             = new List <object>();

            while (personEnumerator.MoveNext())
            {
                list.Add(personEnumerator.Current);
            }
            Assert.AreEqual(2, list.Count);
            Assert.AreSame(gravatarService.Persons[0], list[0] as PersonMock);
            Assert.AreSame(gravatarService.Persons[1], list[1] as PersonMock);
        }