Esempio n. 1
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);
        }
Esempio n. 2
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 WishGetByIdQueryHandlerTests()
        {
            var fixture = new Fixture();

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

            _projectDianaContext = InitializeDatabase();
            _testUser            = fixture.Create <ApplicationUser>();

            _testWishRecord        = fixture.Create <WishRecord>();
            _testWishRecord.User   = _testUser;
            _testWishRecord.UserId = _testUser.Id;

            _testQuery = new WishGetByIdQuery(_testUser.Id, _testWishRecord.Id);

            InitializeDatabase();

            _handler = new WishGetByIdQueryHandler(_projectDianaContext);
        }
        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);
        }