예제 #1
0
        public void 検索条件に一致しない場合0件()
        {
            // Arrange
            var condition = new TeamSearchCondition(
                pageIndex: 1,
                displayCount: 5,
                teamTypes: new int[] { TeamType.Club.Id },
                teamName: "taisei");

            // Act
            var act = condition.Apply(this.teams.AsQueryable()).ToList();

            // Assert
            Assert.Empty(act);
        }
예제 #2
0
        public void 団体をページングして検索()
        {
            // Arrange
            var condition = new TeamSearchCondition(
                pageIndex: 1,
                displayCount: 5,
                teamTypes: new int[] { TeamType.Club.Id },
                teamName: "1");

            // Act
            var act = condition.Apply(this.teams.AsQueryable()).ToList();

            // Assert
            Assert.Single(act);
            Assert.Equal(new TeamCode("S00019"), act.First().TeamCode);
        }
예제 #3
0
        public void 団体を条件なしで検索()
        {
            // Arrange
            var condition = new TeamSearchCondition(
                pageIndex: 0,
                displayCount: 5,
                teamTypes: null,
                teamName: null);

            // Act
            var act = condition.Apply(this.teams.AsQueryable()).ToList();

            // Assert
            Assert.Equal(5, act.Count);
            Assert.Equal(new TeamCode("S00001"), act.First().TeamCode);
        }
예제 #4
0
        public void 団体種別が学校の団体を検索()
        {
            // Arrange
            var condition = new TeamSearchCondition(
                pageIndex: 0,
                displayCount: 5,
                teamTypes: new int[] { TeamType.School.Id },
                teamName: null);

            // Act
            var act = condition.Apply(this.teams.AsQueryable()).ToList();

            // Assert
            Assert.Equal(5, act.Count);
            Assert.Equal(new TeamCode("S00002"), act.First().TeamCode);
            Assert.True(act.All(o => o.TeamType == TeamType.School));
        }