コード例 #1
0
        public void Get_ShouldCallAccept(
            Mock <IObservableViewModelVisitor> visitor,
            IBindable parent,
            ISchedulers schedulers,
            Mock <IObservableViewModelBuilder> ovmBuilder,
            Mock <IObservableViewModel> ovm
            )
        {
            //arrange
            Action <IObservableViewModel> action = null;
            var sut = new ObservableViewModelBuilderProvider(() => schedulers, (a, scheduler, arg3) =>
            {
                action = a;
                return(ovmBuilder.Object);
            });

            sut.AddVisitor(visitor.Object);

            //act
            sut.Get("test");
            action(ovm.Object);

            //assert
            ovm.Verify(o => o.Accept(visitor.Object));
        }
コード例 #2
0
        public void Get_GettingASingleBuilder_ShouldReturnCorrectValue(
            ObservableViewModelBuilderProvider sut,
            string name)
        {
            //arrange

            //act
            var actual = sut.Get(name);

            //assert
            actual.Should().BeOfType <ObservableViewModelBuilder>();
        }
コード例 #3
0
 public void Get_TestGuardClauses(
     GuardClauseAssertion assertion,
     ObservableViewModelBuilderProvider sut)
 {
     assertion.Verify(() => sut.Get(""));
 }