Esempio n. 1
0
        public static T CreateFake <T, U>(this ISubPresenterItemManager <U> subPresenterManager, ISubPresenterItem <T> subPresenterItem)
            where U : ISubPresenter
            where T : class, U
        {
            var subPresenter = A.Fake <T>();

            A.CallTo(() => subPresenter.BaseView).Returns(A.Fake <IView>());
            A.CallTo(() => subPresenterManager.PresenterAt(subPresenterItem)).Returns(subPresenter);
            A.CallTo(() => subPresenterManager.PresenterAt((ISubPresenterItem <U>)subPresenterItem)).Returns(subPresenter);
            var list = (List <U>)subPresenterManager.AllSubPresenters;

            list.Add(subPresenter);
            return(subPresenter);
        }
Esempio n. 2
0
        public static T CreateFake <T, U>(this ISubPresenterItemManager <U> subPresenterManager, SubPresenterItem <T> subPresenterItem)
            where U : ISubPresenter
            where T : U
        {
            var subPresenter = A.Fake <T>();

            A.CallTo(() => subPresenterManager.PresenterAt(subPresenterItem)).Returns(subPresenter);
            return(subPresenter);
        }
Esempio n. 3
0
 protected T PresenterAt <T>(ISubPresenterItem <T> subPresenterItem) where T : TSubPresenter
 {
     return(_subPresenterItemManager.PresenterAt(subPresenterItem));
 }