Ejemplo n.º 1
0
        public void RegisterChild_ShouldRegisterChild(
            TestViewModel sut,
            ViewModelBase child)
        {
            //arrange

            //act
            sut.CallRegisterChild(child);

            //assert
            sut.ViewModels.Should().Contain(child);
        }
Ejemplo n.º 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());
        }
Ejemplo n.º 3
0
 public void Initialize_GuardClauses(
     TestViewModel sut,
  GuardClauseAssertion assertion)
 {
     assertion.Verify((INavigationRequest request) => sut.Initialize(request));
 }
Ejemplo n.º 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());
        }
Ejemplo n.º 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);
        }
Ejemplo n.º 6
0
 public void Initialize_GuardClauses(
     TestViewModel sut,
     GuardClauseAssertion assertion)
 {
     assertion.Verify((INavigationRequest request) => sut.Initialize(request));
 }