Esempio n. 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));
        }
Esempio n. 2
0
        public void CopyVisitors_ShouldCallAddVisitor(
            ObservableViewModelBuilderProvider sut,
            IObservableViewModelVisitor[] visitors,
            Mock <IObservableViewModelBuilderProvider> other)
        {
            //arrange
            foreach (var ovmVisitor in visitors)
            {
                var v = ovmVisitor;
                sut.AddVisitor(ovmVisitor);
                other.Setup(c => c.AddVisitor(v)).Verifiable();
            }

            //act
            sut.CopyVisitors(other.Object);

            //assert
            other.Verify();
        }