コード例 #1
0
    public void Busy_days_for_disappointing_week()
    {
        var counts    = new int[] { 1, 1, 1, 0, 0, 0, 0 };
        var birdCount = new BirdCount(counts);

        Assert.Equal(0, birdCount.BusyDays());
    }
コード例 #2
0
    public void Busy_days_for_busy_week()
    {
        var counts    = new int[] { 4, 9, 5, 7, 8, 8, 2 };
        var birdCount = new BirdCount(counts);

        Assert.Equal(5, birdCount.BusyDays());
    }
コード例 #3
0
    public void Count_for_first_three_days_of_disappointing_week()
    {
        var counts    = new int[] { 0, 0, 1, 0, 0, 1, 0 };
        var birdCount = new BirdCount(counts);

        Assert.Equal(1, birdCount.CountForFirstDays(3));
    }
コード例 #4
0
    public void Count_for_first_six_days_of_busy_week()
    {
        var counts    = new int[] { 5, 9, 12, 6, 8, 8, 17 };
        var birdCount = new BirdCount(counts);

        Assert.Equal(48, birdCount.CountForFirstDays(6));
    }
コード例 #5
0
    public void Has_day_without_birds_with_no_day_without_birds()
    {
        var counts    = new int[] { 4, 5, 9, 10, 9, 4, 3 };
        var birdCount = new BirdCount(counts);

        Assert.False(birdCount.HasDayWithoutBirds());
    }
コード例 #6
0
    public void Today_for_busy_day()
    {
        var counts    = new int[] { 8, 8, 9, 5, 4, 7, 10 };
        var birdCount = new BirdCount(counts);

        Assert.Equal(10, birdCount.Today());
    }
コード例 #7
0
    public void Has_day_without_birds_with_day_without_birds()
    {
        var counts    = new int[] { 5, 5, 4, 0, 7, 6, 7 };
        var birdCount = new BirdCount(counts);

        Assert.True(birdCount.HasDayWithoutBirds());
    }
コード例 #8
0
    public void Today_for_disappointing_day()
    {
        var counts    = new int[] { 0, 0, 1, 0, 0, 1, 0 };
        var birdCount = new BirdCount(counts);

        Assert.Equal(0, birdCount.Today());
    }
コード例 #9
0
    public void TotalForBusyWeek()
    {
        var counts    = new int[] { 5, 9, 12, 6, 8, 8, 17 };
        var birdCount = new BirdCount(counts);

        Assert.Equal(65, birdCount.Total());
    }
コード例 #10
0
    public void TotalForDisappointingWeek()
    {
        var counts    = new int[] { 0, 0, 1, 0, 0, 1, 0 };
        var birdCount = new BirdCount(counts);

        Assert.Equal(2, birdCount.Total());
    }
コード例 #11
0
    public void YesterdayDaysForBusyWeek()
    {
        var counts    = new int[] { 8, 8, 9, 5, 4, 7, 10 };
        var birdCount = new BirdCount(counts);

        Assert.Equal(7, birdCount.Yesterday());
    }
コード例 #12
0
    public void YesterdayForDisappointingWeek()
    {
        var counts    = new int[] { 0, 0, 1, 0, 0, 1, 0 };
        var birdCount = new BirdCount(counts);

        Assert.Equal(1, birdCount.Yesterday());
    }
コード例 #13
0
    public void Increment_todays_count_with_multiple_previous_visits()
    {
        var counts    = new int[] { 8, 8, 9, 2, 1, 6, 4 };
        var birdCount = new BirdCount(counts);

        birdCount.IncrementTodaysCount();
        Assert.Equal(5, birdCount.Today());
    }
コード例 #14
0
    public void Increment_todays_count_with_no_previous_visits()
    {
        var counts    = new int[] { 0, 0, 0, 4, 2, 3, 0 };
        var birdCount = new BirdCount(counts);

        birdCount.IncrementTodaysCount();
        Assert.Equal(1, birdCount.Today());
    }
コード例 #15
0
 public void Last_week()
 {
     Assert.Equal(new int[] { 0, 2, 5, 3, 7, 8, 4 }, BirdCount.LastWeek());
 }