public void ShouldAllowToNavigateToAnotherViewWhenExecutedWhenRegionAndViewAreValid()
        {
            // Given

            IChangeRegionsViewCommand <string> command = new ChangeRegionsViewCommand <string>(_regionManagerMock.Object, _regionName);

            // When

            command.Execute(_viewName);

            // Then

            _regionMock.Verify(r => r.RequestNavigate(new Uri(_viewName, UriKind.RelativeOrAbsolute), It.IsNotNull <Action <NavigationResult> >()), Times.Once);
        }
        public void ShouldNotAllowToChangeRegionsViewProvidedNotRegisteredRegionToNavigate()
        {
            // Given

            var regionCollection      = new TestRegionCollection();
            var regionManagerMock     = new Mock <IRegionManager>();
            var notExistingRegionName = Guid.NewGuid().ToString();

            regionManagerMock.SetupGet(r => r.Regions).Returns(regionCollection);
            IChangeRegionsViewCommand <string> command = new ChangeRegionsViewCommand <string>(regionManagerMock.Object, notExistingRegionName);

            // When
            // Then

            Assert.IsFalse(command.CanExecute(_viewName));
            Assert.Throws <CannotExecuteCommandException>(() => command.Execute(_viewName));
        }