public InvestmentServiceTests() { _mapperMock = new AutoMapperMock(); _userService = new UserServiceMock(); _context = SeedData(5); _investmentRepository = new InvestmentRepositoryMock(_context); _investmentService = new InvestmentService(_investmentRepository, _userService.Object, _mapperMock.Object); }
public CreateGameCommandHandler GetHandler( IMapper mapper = null, IBaseRepository <Game> repository = null, ILogger <CreateGameCommandHandler> logger = null ) { mapper ??= AutoMapperMock.GetDefaultInstance(); repository ??= GameRepositoryMock.GetDefaultInstance(); logger ??= Substitute.For <ILogger <CreateGameCommandHandler> >(); return(new CreateGameCommandHandler( mapper, repository, logger)); }
public CreateFriendCommandHandler GetHandler( IMapper mapper = null, IFriendRepository repository = null, ILogger <CreateFriendCommandHandler> logger = null ) { mapper ??= AutoMapperMock.GetDefaultInstance(); repository ??= Substitute.For <IFriendRepository>(); logger ??= Substitute.For <ILogger <CreateFriendCommandHandler> >(); return(new CreateFriendCommandHandler( mapper, repository, logger)); }
public DeleteFriendCommandHandler GetHandler( IMapper mapper = null, IFriendRepository repository = null, INotificationContext notificationContext = null, ILogger <DeleteFriendCommandHandler> logger = null ) { mapper ??= AutoMapperMock.GetDefaultInstance(); repository ??= Substitute.For <IFriendRepository>(); logger ??= Substitute.For <ILogger <DeleteFriendCommandHandler> >(); notificationContext ??= Substitute.For <INotificationContext>(); return(new DeleteFriendCommandHandler( mapper, repository, logger, notificationContext)); }
public PatchGameCommandHandler GetHandler( IMapper mapper = null, IBaseRepository <Game> repository = null, INotificationContext notificationContext = null, ILogger <PatchGameCommandHandler> logger = null ) { mapper ??= AutoMapperMock.GetDefaultInstance(); repository ??= Substitute.For <IBaseRepository <Game> >(); logger ??= Substitute.For <ILogger <PatchGameCommandHandler> >(); notificationContext ??= Substitute.For <INotificationContext>(); return(new PatchGameCommandHandler( mapper, repository, logger, notificationContext)); }
public CourseInstancesServiceTest() { this.mapper = AutoMapperMock.GetMapper(); this.courseInstancesRepositoryMock = new Mock <IRepository <LearningSystemContext, CourseInstance> >(); this.context = LearningSystemContextMock.GetContext(); }
public void TestInitializer() { this.dbContext = BlogDatabaseMock.GetDbContext(); this.mapper = AutoMapperMock.GetInstance(); }
public BlogArticleServiceTest() { this.blogRepositoryMock = new Mock <IRepository <LearningSystemContext, Article> >(); this.context = LearningSystemContextMock.GetContext(); this.mapper = AutoMapperMock.GetMapper(); }
public void TestInitialize() { this.courseRepositoryMock = new Mock <IRepository <LearningSystemContext, Course> >(); this.context = LearningSystemContextMock.GetContext(); this.mapper = AutoMapperMock.GetMapper(); }