Ejemplo n.º 1
0
        public void GetYearInfo_should_be_callable_indirectly()
        {
            using (new IndirectionsContext())
            {
                // Arrange
                PJapaneseLunisolarCalendar.GetYearInfoInt32Int32().Body = (@this, lunarYear, index) => 41;

                // Act
                var calendar = new JapaneseLunisolarCalendar();
                var actual   = calendar.GetLeapMonth(26, calendar.Eras[0]);

                // Assert
                // Before setting indirection: 平成 26 年 閏 9
                Assert.AreEqual(42, actual);
            }
        }
Ejemplo n.º 2
0
        public void CalEraInfo_should_be_callable_indirectly()
        {
            using (new IndirectionsContext())
            {
                // Arrange
                var japaneseLunisolarCalendar_get_CalEraInfo = default(MethodInfo);
                var expected = default(Array);
                MakeCalEraInfoTestData(out japaneseLunisolarCalendar_get_CalEraInfo, out expected);

                PJapaneseLunisolarCalendar.CalEraInfoGet().Body = args => expected;


                // Act
                var calendar = new JapaneseLunisolarCalendar();
                var actual   = japaneseLunisolarCalendar_get_CalEraInfo.Invoke(calendar, null) as IEnumerable;


                // Assert
                CollectionAssert.AreEqual(expected, actual);
            }
        }