<commit_before>﻿using System;
using Xunit;

namespace Chronic.Tests.Handlers
{
    public class GRGRHandler_correctly_parses : ParsingTestsBase
    {
        protected override DateTime Now()
        {
            return Time.New(2006, 8, 16, 14, 0, 0);
        }

        [Fact]
        public void last_day_of_next_month()
        {
            Parse("last day of next month")
                .AssertStartsAt(Time.New(2006, 9, 30));
        }
        [Fact]
        public void last_day_of_next_month_when_next_month_is_February_in_leap_year()
        {
            When
                .ItIs("1996-01-20")
                .Parsing("last day of next month")
                .ReturnsSpan()
                .StartingAt(Time.New(1996, 2, 29));
        }

        [Fact]
        public void last_day_of_next_month_when_next_month_is_February_in_non_leap_year()
        {
            When
                .ItIs("1997-01-20")
                .Parsing("last day of next month")
                .ReturnsSpan()
                .StartingAt(Time.New(1997, 2, 28));
        }

        [Fact]
        public void last_day_of_this_month()
        {
            Parse("last day of this month")
                .AssertStartsAt(Time.New(2006, 8, 31));
        }

        [Fact]
        public void last_day_of_last_month()
        {
            Parse("last day of last month")
                .AssertStartsAt(Time.New(2006, 7, 31));
        }

        [Fact]
        public void last_day_of_next_week_when_week_starts_on_Monday()
        {
            When
                .ItIs("2006-08-16 14:00:00")
                .Parsing("last day of next week")
                .WithOptions(new { FirstDayOfWeek = DayOfWeek.Monday })
                .ReturnsSpan()
                .StartingAt(Time.New(2006, 8, 27));
        }

        [Fact]
        public void last_day_of_next_week_when_week_starts_on_Sunday()
        {
            When
                .ItIs("2006-08-16 14:00:00")
                .Parsing("last day of next week")
                .WithOptions(new { FirstDayOfWeek = DayOfWeek.Sunday })
                .ReturnsSpan()
                .StartingAt(Time.New(2006, 8, 26));
        }

        [Fact]
        public void last_day_of_this_week_when_week_starts_on_Sunday()
        {
            When
                .ItIs("2006-08-16 14:00:00")
                .Parsing("last day of this week")
                .WithOptions(new { FirstDayOfWeek = DayOfWeek.Sunday })
                .ReturnsSpan()
                .StartingAt(Time.New(2006, 8, 19));
        }

        [Fact]
        public void last_day_of_this_week_when_week_starts_on_Monday()
        {
            When
                .ItIs("2006-08-16 14:00:00")
                .Parsing("last day of this week")
                .WithOptions(new { FirstDayOfWeek = DayOfWeek.Monday })
                .ReturnsSpan()
                .StartingAt(Time.New(2006, 8, 20));
        }
    }
}<commit_msg>additional tests for 'first day of this week'<commit_after>﻿using System;
using Xunit;

namespace Chronic.Tests.Handlers
{
    public class GRGRHandler_correctly_parses : ParsingTestsBase
    {
        protected override DateTime Now()
        {
            return Time.New(2006, 8, 16, 14, 0, 0);
        }

        [Fact]
        public void last_day_of_next_month()
        {
            Parse("last day of next month")
                .AssertStartsAt(Time.New(2006, 9, 30));
        }
        [Fact]
        public void last_day_of_next_month_when_next_month_is_February_in_leap_year()
        {
            When
                .ItIs("1996-01-20")
                .Parsing("last day of next month")
                .ReturnsSpan()
                .StartingAt(Time.New(1996, 2, 29));
        }

        [Fact]
        public void last_day_of_next_month_when_next_month_is_February_in_non_leap_year()
        {
            When
                .ItIs("1997-01-20")
                .Parsing("last day of next month")
                .ReturnsSpan()
                .StartingAt(Time.New(1997, 2, 28));
        }

        [Fact]
        public void last_day_of_this_month()
        {
            Parse("last day of this month")
                .AssertStartsAt(Time.New(2006, 8, 31));
        }

        [Fact]
        public void last_day_of_last_month()
        {
            Parse("last day of last month")
                .AssertStartsAt(Time.New(2006, 7, 31));
        }

        [Fact]
        public void last_day_of_next_week_when_week_starts_on_Monday()
        {
            When
                .ItIs("2006-08-16 14:00:00")
                .Parsing("last day of next week")
                .WithOptions(new { FirstDayOfWeek = DayOfWeek.Monday })
                .ReturnsSpan()
                .StartingAt(Time.New(2006, 8, 27));
        }

        [Fact]
        public void last_day_of_next_week_when_week_starts_on_Sunday()
        {
            When
                .ItIs("2006-08-16 14:00:00")
                .Parsing("last day of next week")
                .WithOptions(new { FirstDayOfWeek = DayOfWeek.Sunday })
                .ReturnsSpan()
                .StartingAt(Time.New(2006, 8, 26));
        }

        [Fact]
        public void last_day_of_this_week_when_week_starts_on_Sunday()
        {
            When
                .ItIs("2006-08-16 14:00:00")
                .Parsing("last day of this week")
                .WithOptions(new { FirstDayOfWeek = DayOfWeek.Sunday })
                .ReturnsSpan()
                .StartingAt(Time.New(2006, 8, 19));
        }

        [Fact]
        public void last_day_of_this_week_when_week_starts_on_Monday()
        {
            When
                .ItIs("2006-08-16 14:00:00")
                .Parsing("last day of this week")
                .WithOptions(new { FirstDayOfWeek = DayOfWeek.Monday })
                .ReturnsSpan()
                .StartingAt(Time.New(2006, 8, 20));
        }

        [Fact]
        public void first_day_of_this_week_when_week_starts_on_Monday()
        {
            When
                .ItIs("2006-08-16 14:00:00")
                .Parsing("first day of this week")
                .WithOptions(new { FirstDayOfWeek = DayOfWeek.Monday })
                .ReturnsSpan()
                .StartingAt(Time.New(2006, 8, 14));
        }

        [Fact]
        public void first_day_of_this_week_when_week_starts_on_Sunday()
        {
            When
                .ItIs("2006-08-16 14:00:00")
                .Parsing("first day of this week")
                .WithOptions(new { FirstDayOfWeek = DayOfWeek.Sunday })
                .ReturnsSpan()
                .StartingAt(Time.New(2006, 8, 13));
        }
    }
}
{'fraction_non_alphanumeric': 0.10164917541229385, 'fraction_numerical': 0.05007496251874063, 'mean_word_length': 1.4364499634769905, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4552802', 'n_tokens_mistral': 2363, 'n_tokens_neox': 1956, 'n_words': 371}