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

            //act
            sut.CallRegisterChild(child);

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