示例#1
0
        public RefreshTokenCreateCommandHandlerTests()
        {
            var fixture = new Fixture();

            _testCommand  = fixture.Create <RefreshTokenCreateCommand>();
            _writeContext = InitializeDatabase();

            _handler = new RefreshTokenCreateCommandHandler(_writeContext);
        }
示例#2
0
        public WishCreateCommandHandlerTests()
        {
            var fixture = new Fixture();

            _testCommand  = fixture.Create <WishCreateCommand>();
            _writeContext = InitializeDatabase();

            _handler = new WishCreateCommandHandler(_writeContext);
        }
示例#3
0
        public RefreshTokenClearExpiredForUserCommandHandlerTests()
        {
            _fixture = new Fixture();
            _fixture.Behaviors.Add(new OmitOnRecursionBehavior());

            _context = InitializeDatabase();

            _testCommand = _fixture.Create <RefreshTokenClearExpiredForUserCommand>();

            _handler = new RefreshTokenClearExpiredForUserCommandHandler(_context);
        }
示例#4
0
        public WishCompleteItemCommandHandlerTests()
        {
            var fixture = new Fixture();

            fixture.Behaviors.Add(new OmitOnRecursionBehavior());

            _testRecord  = fixture.Create <WishRecord>();
            _testCommand = new WishCompleteItemCommand(_testRecord.User.Id, _testRecord.Id);

            _writeContext = InitializeDatabase();

            _handler = new WishCompleteItemCommandHandler(_writeContext);
        }
示例#5
0
        public WishDeleteCommandHandlerTests()
        {
            var fixture = new Fixture();

            fixture.Behaviors.Add(new OmitOnRecursionBehavior());

            _context = InitializeDatabase();

            _testCommand = fixture.Create <WishDeleteCommand>();
            _testRecord  = fixture
                           .Build <WishRecord>()
                           .With(w => w.Id, _testCommand.Id)
                           .With(w => w.User, _testCommand.User)
                           .With(w => w.UserId, _testCommand.User.Id)
                           .Create();

            _handler = new WishDeleteCommandHandler(_context);
        }
        public BookAddToShowcaseCommandHandlerTests()
        {
            _fixture = new Fixture();
            _fixture.Behaviors.Add(new OmitOnRecursionBehavior());

            _context = InitializeDatabase();

            _testCommand = _fixture.Create <BookAddToShowcaseCommand>();
            _testBook    = _fixture
                           .Build <BookRecord>()
                           .With(a => a.Id, _testCommand.BookId)
                           .With(a => a.IsShowcased, false)
                           .With(a => a.UpdatedOn, DateTimeOffset.UtcNow)
                           .With(a => a.User, _testCommand.User)
                           .With(a => a.UserId, _testCommand.User.Id)
                           .Create();

            _handler = new BookAddToShowcaseCommandHandler(_context);
        }
        public BookUpdateCommandHandlerTests()
        {
            _fixture = new Fixture();
            _fixture.Behaviors.Add(new OmitOnRecursionBehavior());

            _context = InitializeDatabase();

            _testCommand = CreateTestCommand(
                Guid.NewGuid(),
                CompletionStatusReference.Completed,
                false,
                false,
                1,
                Guid.NewGuid());

            var checkout = _fixture
                           .Build <CheckoutRecord>()
                           .With(c => c.ModifiedOn, DateTimeOffset.UtcNow)
                           .Create();

            var itemStorage = _fixture
                              .Build <ItemStorageRecord>()
                              .With(a => a.ModifiedOn, DateTimeOffset.UtcNow)
                              .Create();

            _testBook = _fixture
                        .Build <BookRecord>()
                        .With(a => a.Id, _testCommand.BookId)
                        .With(a => a.Author, _testCommand.Author)
                        .With(a => a.Checkout, checkout)
                        .With(a => a.UpdatedOn, DateTimeOffset.UtcNow)
                        .With(a => a.ItemStorage, itemStorage)
                        .With(a => a.Type, _testCommand.Type)
                        .With(a => a.TimesCompleted, 1)
                        .With(a => a.Title, _testCommand.Title)
                        .With(a => a.User, _testCommand.User)
                        .With(a => a.UserId, _testCommand.User.Id)
                        .Create();

            _handler = new BookUpdateCommandHandler(_context);
        }
        public WishUpdateCommandHandlerTests()
        {
            _fixture = new Fixture();
            _fixture.Behaviors.Add(new OmitOnRecursionBehavior());

            _testRecord  = _fixture.Create <WishRecord>();
            _testCommand = new WishUpdateCommand(
                "api",
                "category",
                "image",
                true,
                ItemReference.Album,
                "note",
                "title",
                _testRecord.User.Id,
                _testRecord.Id);

            _writeContext = InitializeDatabase();

            _handler = new WishUpdateCommandHandler(_writeContext);
        }
        public AlbumSubmissionCommandHandlerTests()
        {
            _fixture = new Fixture();
            _fixture.Behaviors.Add(new OmitOnRecursionBehavior());

            _context = InitializeDatabase();

            var config = new MapperConfiguration(x =>
            {
                x.AddProfile <AlbumMappingProfile>();
                x.AddProfile <CheckoutMappingProfile>();
                x.AddProfile <ItemStorageMappingProfile>();
            });

            config.AssertConfigurationIsValid();

            var mapper = new Mapper(config);

            _testCommand = CreateTestCommand(1, Guid.NewGuid());

            _handler = new AlbumSubmissionCommandHandler(_context, mapper);
        }
示例#10
0
 public WishDeleteCommandHandler(IProjectDianaWriteContext context) => _context = context;
示例#11
0
 public GameSubmissionCommandHandler(IProjectDianaWriteContext context, IMapper mapper)
 {
     _context = context;
     _mapper  = mapper;
 }
示例#12
0
 public RefreshTokenCreateCommandHandler(IProjectDianaWriteContext context) => _context = context;
示例#13
0
 public GameIncrementPlayCountCommandHandler(IProjectDianaWriteContext context) => _context = context;
示例#14
0
 public AlbumClearShowcaseCommandHandler(IProjectDianaWriteContext context) => _context = context;
示例#15
0
 public RefreshTokenClearExpiredForUserCommandHandler(IProjectDianaWriteContext context) => _context = context;
示例#16
0
 public AlbumUpdateCommandHandler(IProjectDianaWriteContext context) => _context = context;
示例#17
0
 public BookIncrementReadCountCommandHandler(IProjectDianaWriteContext context) => _context = context;
示例#18
0
 public MovieAddToShowcaseCommandHandler(IProjectDianaWriteContext context) => _context = context;
示例#19
0
 public MovieRemoveFromShowcaseCommandHandler(IProjectDianaWriteContext context) => _context = context;