コード例 #1
0
        public async Task Selects_AllLimits()
        {
            // Arrange
            const int expected = 2;

            using (var context = new DueltankDbContext(_dbContextOptions))
            {
                context.Limit.Add(new Limit
                {
                    Name    = "Forbidden",
                    Created = DateTime.UtcNow,
                    Updated = DateTime.UtcNow
                });
                context.Limit.Add(new Limit
                {
                    Name    = "Limited",
                    Created = DateTime.UtcNow,
                    Updated = DateTime.UtcNow
                });

                context.SaveChanges();
            }

            // Act
            var result = await _sut.AllLimits();

            // Assert
            result.Count.Should().Be(expected);
        }
コード例 #2
0
        public async Task Selects_All_Attributes()
        {
            // Arrange
            var expected = 2;

            using (var context = new DueltankDbContext(_dbContextOptions))
            {
                context.Format.Add(new Format
                {
                    Name    = "TCG",
                    Created = DateTime.UtcNow,
                    Updated = DateTime.UtcNow
                });
                context.Format.Add(new Format
                {
                    Name    = "OCG",
                    Created = DateTime.UtcNow,
                    Updated = DateTime.UtcNow
                });

                context.SaveChanges();
            }

            // Act
            var result = await _sut.AllFormats();

            // Assert
            result.Count.Should().Be(expected);
        }
コード例 #3
0
        public async Task Selects_All_Categories()
        {
            // Arrange
            var expected = 2;

            using (var context = new DueltankDbContext(_dbContextOptions))
            {
                context.Category.Add(new Category
                {
                    Name    = "Monster",
                    Created = DateTime.UtcNow,
                    Updated = DateTime.UtcNow
                });
                context.Category.Add(new Category
                {
                    Name    = "Spell",
                    Created = DateTime.UtcNow,
                    Updated = DateTime.UtcNow
                });

                context.SaveChanges();
            }

            // Act
            var result = await _sut.AllCategories();

            // Assert
            result.Count.Should().Be(expected);
        }
コード例 #4
0
        public async Task Selects_All_Cards()
        {
            // Arrange
            const int expected = 77585513;

            using (var context = new DueltankDbContext(_dbContextOptions))
            {
                context.Card.Add(new Card
                {
                    Name        = "Jinzo",
                    CardNumber  = 77585513,
                    Description = "Trap Cards, and their effects on the field, cannot be activated. Negate all Trap effects on the field.",
                    Created     = DateTime.UtcNow,
                    Updated     = DateTime.UtcNow
                });

                context.SaveChanges();
            }

            // Act
            var result = await _sut.GetCardByNumber(77585513);

            // Assert
            result.CardNumber.Should().Be(expected);
        }
コード例 #5
0
        public async Task Selects_All_Types()
        {
            // Arrange
            var expected = 2;

            using (var context = new DueltankDbContext(_dbContextOptions))
            {
                context.Type.Add(new Type
                {
                    Name    = "Earth",
                    Created = DateTime.UtcNow,
                    Updated = DateTime.UtcNow
                });
                context.Type.Add(new Type
                {
                    Name    = "Water",
                    Created = DateTime.UtcNow,
                    Updated = DateTime.UtcNow
                });

                context.SaveChanges();
            }

            // Act
            var result = await _sut.AllTypes();

            // Assert
            result.Count.Should().Be(expected);
        }
コード例 #6
0
 public DeckTypeRepository(DueltankDbContext dbContext)
 {
     _dbContext = dbContext;
 }
コード例 #7
0
 public FormatRepository(DueltankDbContext context)
 {
     _context = context;
 }
コード例 #8
0
ファイル: TipRepository.cs プロジェクト: fablecode/dueltank
 public TipRepository(DueltankDbContext dbContext)
 {
     _dbContext = dbContext;
 }
コード例 #9
0
 public CategoryRepository(DueltankDbContext dbContext)
 {
     _dbContext = dbContext;
 }
コード例 #10
0
 public RulingRepository(DueltankDbContext dbContext)
 {
     _dbContext = dbContext;
 }
コード例 #11
0
 public AttributeRepository(DueltankDbContext dbContext)
 {
     _dbContext = dbContext;
 }
コード例 #12
0
 public ArchetypeRepository(DueltankDbContext dbContext)
 {
     _dbContext = dbContext;
 }
コード例 #13
0
ファイル: UserRepository.cs プロジェクト: fablecode/dueltank
 public UserRepository(DueltankDbContext dbContext)
 {
     _dbContext = dbContext;
 }
コード例 #14
0
 public DeckCardRepository(DueltankDbContext dbContext)
 {
     _dbContext = dbContext;
 }
コード例 #15
0
 public BanlistRepository(DueltankDbContext dbContext)
 {
     _dbContext = dbContext;
 }
コード例 #16
0
ファイル: LimitRepository.cs プロジェクト: fablecode/dueltank
 public LimitRepository(DueltankDbContext dbContext)
 {
     _dbContext = dbContext;
 }