示例#1
0
        public void People_OnClearPeople_IsEmpty()
        {
            IPersonReader reader    = new FakeReader();
            var           viewModel = new PeopleViewModel(reader);

            viewModel.RefreshPeople();
            Assert.AreNotEqual(0, viewModel.People.Count());
            viewModel.ClearPeople();
            Assert.AreEqual(0, viewModel.People.Count());
        }
        public void People_OnClearPeople_IsEmpty()
        {
            //Arrange
            var reader    = new FakeReader();
            var viewModel = new PeopleViewModel(reader);

            viewModel.RefreshPeople();
            Assert.AreNotEqual(0, viewModel.People.Count(), "Invalid arrange");
            //Act
            viewModel.ClearPeople();
            //Assert
            Assert.AreEqual(0, viewModel.People.Count());
        }
示例#3
0
        public void KorangaMoonjiTEst()
        {
            //arrange
            var reader        = new MockReader();
            var mockviewModel = new PeopleViewModel(reader);

            mockviewModel.RefreshPeople();

            //act
            mockviewModel.ClearPeople();


            //assert
            Assert.AreEqual(0, mockviewModel.People.Count());
        }
示例#4
0
        public void ClearPeople_OnExecute_PeopleIsEmpty()
        {
            // Arrange
            var reader = GetTestReader();
            var vm     = new PeopleViewModel(reader);

            vm.RefreshPeople();
            Assert.AreEqual(2, vm.People.Count(), "Invalid Arrangement");

            // Act
            vm.ClearPeople();

            // Assert
            Assert.AreEqual(0, vm.People.Count());
        }
        public void ClearPeople_OnExecute_PeopleIsEmpty()
        {
            // Arrange
            var repository = GetFakeRepository();
            var vm         = new PeopleViewModel(repository); // Constructor Injection of a Fake Repository

            vm.RefreshPeople();
            Assert.AreEqual(2, vm.People.Count(), "Invalid Arrangement");

            // Act
            vm.ClearPeople();

            // Assert
            Assert.AreEqual(0, vm.People.Count());
        }
示例#6
0
        public void People_OnClearPeople_IsEmpty()
        {
            // Arrange (set up)
            var dataReader      = new FakeReader();
            var peopleViewModel = new PeopleViewModel(dataReader);

            peopleViewModel.RefreshPeople();    // just to be sure that the People property was cleared properly...
            Assert.AreNotEqual(0, peopleViewModel.People.Count(), "Invalid Arrangement");

            // Act
            peopleViewModel.ClearPeople();

            // Assert
            Assert.AreEqual(0, peopleViewModel.People.Count());
        }
示例#7
0
        public void ClearPeople_OnExecute_PeopleIsEmpty()
        {
            // Arrange
            IPersonReader reader = readerMock.Object;

            var vm = new PeopleViewModel(reader);

            vm.RefreshPeople();
            Assert.AreEqual(2, vm.People.Count());

            // Act
            vm.ClearPeople();

            // Assert
            Assert.AreEqual(0, vm.People.Count());
        }
 private void ClearButton_Click(object sender, RoutedEventArgs e)
 {
     viewModel.ClearPeople();
     ClearRepositoryType();
 }