Exemplo n.º 1
0
        public void Equals_Object_IsType()
        {
            object target = new MonthYearPart(4, 2013);
            var    actual = new MonthYearPart(4, 2013).Equals(target);

            actual.Should().BeTrue();
        }
Exemplo n.º 2
0
        public void FirstDayOfMonth_IsValid()
        {
            var target = new MonthYearPart(4, 2013);
            var actual = target.FirstDayOfMonth();

            actual.Year.Should().Be(target.Year);
            actual.Month.Should().Be(target.Month);
            actual.Day.Should().Be(1);
        }
Exemplo n.º 3
0
        public void OpNotEqual_IsTrue()
        {
            var left  = new MonthYearPart(4, 2000);
            var right = new MonthYearPart(4, 2010);

            var actual = left != right;

            actual.Should().BeTrue();
        }
Exemplo n.º 4
0
        public void Ctor_IsValid()
        {
            var expectedYear  = 2000;
            var expectedMonth = 10;

            var target = new MonthYearPart(expectedMonth, expectedYear);

            target.Year.Should().Be(expectedYear);
            target.Month.Should().Be(expectedMonth);
        }
Exemplo n.º 5
0
        public void Day_IsValid()
        {
            var expectedYear  = 2013;
            var expectedMonth = 2;
            var expectedDay   = 28;

            var target = new MonthYearPart(expectedMonth, expectedYear).Day(expectedDay);

            target.Month.Should().Be(expectedMonth);
            target.Day.Should().Be(expectedDay);
            target.Year.Should().Be(expectedYear);
        }
Exemplo n.º 6
0
 public MonthYearComponentAttribute(MonthYearPart monthYearPart)
 {
     this.monthYearPart = monthYearPart;
 }
Exemplo n.º 7
0
        public void Equals_Object_IsNotType()
        {
            var actual = new MonthYearPart(4, 2000).Equals("Hello");

            actual.Should().BeFalse();
        }
Exemplo n.º 8
0
        public void Equals_Object_IsNull()
        {
            var actual = new MonthYearPart(4, 2013).Equals(null);

            actual.Should().BeFalse();
        }
Exemplo n.º 9
0
        public void Equals_Type_IsFalse()
        {
            var actual = new MonthYearPart(5, 2012).Equals(new MonthYearPart(4, 2013));

            actual.Should().BeFalse();
        }
Exemplo n.º 10
0
        public void Equals_Type_IsTrue()
        {
            var actual = new MonthYearPart(4, 2013).Equals(new MonthYearPart(4, 2013));

            actual.Should().BeTrue();
        }