public void View()
		{
			// Arrange
			var selectedFriend = new Person();

			ViewPersonMessage publishedMessage = null;
			EventAggregator.Publish(Arg.Do<ViewPersonMessage>(m => publishedMessage = m));

			// Act
			ViewModel.View(selectedFriend);

			// Assert
			Assert.AreSame(selectedFriend, publishedMessage.Person);
		}
		public void Person_NotNull()
		{
			// Arrange
			var person = new Person { Name = "Bob" };

			// Act
			ViewModel.PropertyChanged += OnPropertyChanged;
			ViewModel.Person = person;
			ViewModel.PropertyChanged -= OnPropertyChanged;

			// Assert
			Assert.AreSame(person, ViewModel.Person, "Person");
			Assert.IsTrue(PropertiesChanged.Contains("Person"), "Property Changed");
			Assert.AreEqual("Edit Bob", ViewModel.DisplayName, "DisplayName");
		}
		public void Person_NotNull()
		{
			// Arrange
			var viewModel = new ViewPersonViewModel();

			var name = Guid.NewGuid().ToString();
			var person = new Person { Name = name };

			// Act
			viewModel.Person = person;

			// Assert
			Assert.AreSame(person, viewModel.Person, "Person");
			Assert.AreEqual(name, viewModel.DisplayName, "DisplayName");
		}
		public void ViewModelInitialized()
		{
			// Arrange
			var friend = new Person();
			var friends = new List<Person>();
			friends.Add(friend);

			PersonRepository.GetAllFriends().Returns(friends);

			// Act
			((IActivate)ViewModel).Activate();

			// Assert
			Assert.AreSame(friend, ViewModel.Friends[0]);
		}
		public void Handle_EditPersonMessage()
		{
			// Arrange
			var editPersonViewModel = new EditPersonViewModel();
			IoC.GetInstance = (type, key) =>
				{
					return editPersonViewModel;
				};

			var person = new Person();
			var message = new EditPersonMessage { Person = person };

			// Act
			ViewModel.Handle(message);

			// Assert
			Assert.AreSame(person, editPersonViewModel.Person);
			WindowManager.Received().ShowDialog(editPersonViewModel);
		}
		public void Handle_ViewPersonMessage()
		{
			// Arrange
			var viewPersonViewModel = new ViewPersonViewModel();
			IoC.GetInstance = (type, key) =>
			{
				return viewPersonViewModel;
			};

			var person = new Person();
			var message = new ViewPersonMessage { Person = person };

			// Act
			ViewModel.Handle(message);

			// Assert
			Assert.AreSame(person, viewPersonViewModel.Person, "Person");
			Assert.AreEqual(1, ViewModel.Items.Count, "Items Count");
			Assert.AreSame(viewPersonViewModel, ViewModel.ActiveItem, "ActiveItem");
		}
		public void View(Person person)
		{
			EventAggregator.Publish(new ViewPersonMessage { Person = person });
		}
		public void SelectedPerson()
		{
			// Arrange
			var person = new Person();

			// Act
			ViewModel.PropertyChanged += OnPropertyChanged;
			ViewModel.SelectedPerson = person;
			ViewModel.PropertyChanged -= OnPropertyChanged;

			// Assert
			Assert.AreSame(person, ViewModel.SelectedPerson, "SelectedPerson");
			Assert.IsTrue(PropertiesChanged.Contains("SelectedPerson"), "Property Changed");
		}