コード例 #1
0
        public void UnityContainerIsNull_ThrowException()
        {
            //Act
            TestDelegate action = () =>
            {
                new UnityDataStorage(null);
            };

            //Assert
            Assert.That(action, ThrowsException.NullArgument(ArgumentNames.UnityContainer));
        }
コード例 #2
0
        public void GetDataContext_ControlIsNull_ThrowException()
        {
            //Act
            void Action()
            {
                _viewInteractionStrategy.GetDataContext(null);
            }

            //Assert
            Assert.That(Action, ThrowsException.NullArgument(ArgumentNames.Control));
        }
コード例 #3
0
        public void RegisterNavigationManager_FrameControlTypeIsNull_ThrowException()
        {
            //Act
            void Action()
            {
                _unityContainer.RegisterNavigationManager(_frameControl, _navigationManagerType, null, _injectionMembers);
            }

            //Assert
            Assert.That(Action, ThrowsException.NullArgument(ArgumentNames.FrameControlType));
        }
コード例 #4
0
        public void SetContent_ControlIsNull_ThrowException()
        {
            //Act
            void Action()
            {
                _viewInteractionStrategy.SetContent(null, new object());
            }

            //Assert
            Assert.That(Action, ThrowsException.NullArgument(ArgumentNames.Control));
        }
コード例 #5
0
        public void Get_KeyIsNull_ThrowException()
        {
            //Act
            TestDelegate action = () =>
            {
                _dataStorage.Get(null);
            };

            //Assert
            Assert.That(action, ThrowsException.NullArgument(ArgumentNames.Key));
        }
コード例 #6
0
        public void Add_KeyIsNull_ThrowException()
        {
            //Act
            TestDelegate action = () =>
            {
                _dataStorage.Add(null, _navigationData);
            };

            //Assert
            Assert.That(action, ThrowsException.NullArgument(ArgumentNames.Key));
        }
コード例 #7
0
        public void RegisterNavigationRule_NavigationKeyIsNull_ThrowException()
        {
            //Assert
            _navigationKey = null;

            //Act
            void Action()
            {
                _unityContainer.RegisterNavigationRule <object, object>(_navigationKey);
            }

            //Assert
            Assert.That(Action, ThrowsException.NullArgument(ArgumentNames.NavigationKey));
        }
コード例 #8
0
        public void RegisterNavigationRule_UnityContainerIsNull_ThrowException()
        {
            //Arrange
            _unityContainer = null;

            //Act
            void Action()
            {
                _unityContainer.RegisterNavigationRule <InstanceClass, object>(_navigationKey);
            }

            //Assert
            Assert.That(Action, ThrowsException.NullArgument(ArgumentNames.UnityContainer));
        }
コード例 #9
0
        public void RegisterNavigationManager_FrameControlTypeProviderIsNull_ThrowException()
        {
            //Arrange
            var navigationManagerTypeProvider = Mock.Of <INavigationManagerTypeProvider>();

            //Act
            void Action()
            {
                _unityContainer.RegisterNavigationManager(_frameControl, navigationManagerTypeProvider, null);
            }

            //Assert
            Assert.That(Action, ThrowsException.NullArgument(ArgumentNames.FrameControlTypeProvider));
        }
コード例 #10
0
        public void InvokeInDispatcher_ActionIsNull_ThrowException()
        {
            //Arrange
            var contentControl = new TContentControl();

            //Act
            void Action()
            {
                _viewInteractionStrategy.InvokeInDispatcher(contentControl, null);
            }

            //Assert
            Assert.That(Action, ThrowsException.NullArgument(ArgumentNames.Action));
        }
コード例 #11
0
        public void Add_NavigationDataIsNull_ThrowException()
        {
            //Arrange
            const string key = "key";

            //Act
            TestDelegate action = () =>
            {
                _dataStorage.Add(key, null);
            };

            //Assert
            Assert.That(action, ThrowsException.NullArgument(ArgumentNames.NavigationData));
        }
コード例 #12
0
        public void InvokeInDispatcher_ControlIsNull_ThrowException()
        {
            //Arrange
            void DoSomething()
            {
            }

            //Act
            void Action()
            {
                _viewInteractionStrategy.InvokeInDispatcher(null, DoSomething);
            }

            //Assert
            Assert.That(Action, ThrowsException.NullArgument(ArgumentNames.Control));
        }