Example #1
0
        public void RegisterChild_ShouldRegisterChild(
            TestViewModel sut,
            ViewModelBase child)
        {
            //arrange

            //act
            sut.CallRegisterChild(child);

            //assert
            sut.ViewModels.Should().Contain(child);
        }
Example #2
0
        public void Dispose_ShouldDisposeChildren(
            TestViewModel sut,
            Mock<ViewModelBase> child)
        {
            //arrange
            sut.CallRegisterChild(child.Object);

            //act
            sut.Dispose();

            //assert
            child.Verify(@base => @base.Dispose());
        }
Example #3
0
 public void Initialize_GuardClauses(
     TestViewModel sut,
  GuardClauseAssertion assertion)
 {
     assertion.Verify((INavigationRequest request) => sut.Initialize(request));
 }
Example #4
0
        public void Register_WhenAlreadyInitialized_ShouldCallChildrenInitialize(
         TestViewModel sut,
            Mock<ViewModelBase> child,
            INavigationRequest request)
        {
            //arrange
            child.As<IViewModel>();
            sut.Initialize(request);

            //act
            sut.CallRegisterChild(child.Object);

            //assert
            child.As<IViewModel>().Verify(c => c.Initialize(request), Times.Once());
        }
Example #5
0
        public void RegisterChild_ShouldReturnViewModel(
         TestViewModel sut,
            Mock<ViewModelBase> child)
        {
            //arrange

            //act
            var actual = sut.CallRegisterChild(child.Object);

            //assert
            actual.Should().Be(child.Object);
        }
Example #6
0
 public void Initialize_GuardClauses(
     TestViewModel sut,
     GuardClauseAssertion assertion)
 {
     assertion.Verify((INavigationRequest request) => sut.Initialize(request));
 }