コード例 #1
0
ファイル: PeriodTests.cs プロジェクト: chris-nolan/Transacto
        public static IEnumerable <object[]> ContainsCases()
        {
            var fixture = new ScenarioFixture();
            var period  = fixture.Create <Period>();

            var daysInMonth = CultureInfo.InvariantCulture.Calendar.GetDaysInMonth(period.Year, period.Month);

            foreach (var day in Enumerable.Range(1, daysInMonth))
            {
                yield return(new object[]
                             { period, new DateTimeOffset(new DateTime(period.Year, period.Month, day), TimeSpan.Zero), true });
            }

            yield return(new object[] {
                period,
                new DateTimeOffset(new DateTime(period.Year, period.Month, daysInMonth).AddDays(1), TimeSpan.Zero),
                false
            });

            yield return(new object[]
                         { period, new DateTimeOffset(new DateTime(period.Year, period.Month, 1).AddDays(-1), TimeSpan.Zero), false });

            yield return(new object[]
                         { period, new DateTimeOffset(new DateTime(period.Year, period.Month, 1), TimeSpan.FromHours(-1)), false });
        }
コード例 #2
0
        public static IEnumerable <object[]> InvalidPrefixCases()
        {
            var fixture = new ScenarioFixture();

            yield return(new object[] { " ", fixture.Create <int>() });

            yield return(new object[] { string.Empty, fixture.Create <int>() });

            yield return(new object[] { " a", fixture.Create <int>() });

            yield return(new object[] { "a ", fixture.Create <int>() });

            yield return(new object[] { "a	", fixture.Create <int>() });

            yield return(new object[]
                         { new string('a', GeneralLedgerEntryNumber.MaxPrefixLength + 1), fixture.Create <int>() });
        }
コード例 #3
0
        public static IEnumerable <object[]> ContainsCases()
        {
            var fixture = new ScenarioFixture();
            var date    = fixture.Create <LocalDate>().ToYearMonth().OnDayOfMonth(1);

            var period = AccountingPeriod.Open(date);

            var daysInMonth = CalendarSystem.Iso.GetDaysInMonth(date.Year, date.Month);

            for (var day = 0; day < daysInMonth; day++)
            {
                yield return(new object[] { period, date.PlusDays(day), true });
            }

            yield return(new object[] { period, date.PlusDays(daysInMonth), false });

            yield return(new object[] { period, date.PlusDays(-1), false });
        }
コード例 #4
0
ファイル: AccountTests.cs プロジェクト: dmmusil/Transacto
 public AccountTests()
 {
     _fixture = new ScenarioFixture();
 }
コード例 #5
0
 private DomElement(string elementFetchFunction, ScenarioFixture fixture)
 {
     _ElementFetchFunction = elementFetchFunction;
     _Fixture = fixture;
 }
コード例 #6
0
 public static DomElement ByName(string name, ScenarioFixture fixture)
 {
     return(new DomElement(" return document.getElementsByName('" + name + "')[0]", fixture));
 }
コード例 #7
0
 public static DomElement ByCssSelector(string cssSelector, ScenarioFixture fixture)
 {
     return(new DomElement(" return document.querySelector('" + cssSelector + "')", fixture));
 }