Exemplo n.º 1
0
        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));
        }
Exemplo n.º 3
0
        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));
        }
Exemplo n.º 5
0
        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();
 }
Exemplo n.º 7
0
 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();
 }
Exemplo n.º 9
0
 public void TestInitialize()
 {
     this.courseRepositoryMock = new Mock <IRepository <LearningSystemContext, Course> >();
     this.context = LearningSystemContextMock.GetContext();
     this.mapper  = AutoMapperMock.GetMapper();
 }