Exemplo n.º 1
0
        public void PProxyJapaneseLunisolarCalendarDefaultBehavior_can_apply_default_behavior_to_throw_NotImplementedException_against_one_instance()
        {
            // Arrange
            var proxy = new PProxyJapaneseLunisolarCalendar();

            proxy.
            ExcludeGeneric().
            DefaultBehavior = IndirectionBehaviors.NotImplemented;

            {
                var bag = TaggedBagFactory <OfPJapaneseLunisolarCalendar.GetYearInfoInt32Int32Impl> .Make(proxy.GetYearInfoInt32Int32().Body);

                LooseCrossDomainAccessor.GetOrRegister <GenericHolder <TaggedBag <OfPJapaneseLunisolarCalendar.GetYearInfoInt32Int32Impl, IndirectionFunc <JapaneseLunisolarCalendar, int, int, int> > > >().Source = bag;
            }
            {
                var bag = TaggedBagFactory <OfPJapaneseLunisolarCalendar.GetGregorianYearInt32Int32Impl> .Make(proxy.GetGregorianYearInt32Int32().Body);

                LooseCrossDomainAccessor.GetOrRegister <GenericHolder <TaggedBag <OfPJapaneseLunisolarCalendar.GetGregorianYearInt32Int32Impl, IndirectionFunc <JapaneseLunisolarCalendar, int, int, int> > > >().Source = bag;
            }
            LooseCrossDomainAccessor.GetOrRegister <GenericHolder <JapaneseLunisolarCalendar> >().Source = (JapaneseLunisolarCalendar)proxy;


            // Act
            var getYearInfoTarget      = LooseCrossDomainAccessor.GetOrRegister <GenericHolder <TaggedBag <OfPJapaneseLunisolarCalendar.GetYearInfoInt32Int32Impl, IndirectionFunc <JapaneseLunisolarCalendar, int, int, int> > > >().Source.Value;
            var getGregorianYearTarget = LooseCrossDomainAccessor.GetOrRegister <GenericHolder <TaggedBag <OfPJapaneseLunisolarCalendar.GetGregorianYearInt32Int32Impl, IndirectionFunc <JapaneseLunisolarCalendar, int, int, int> > > >().Source.Value;
            var target = LooseCrossDomainAccessor.GetOrRegister <GenericHolder <JapaneseLunisolarCalendar> >().Source;


            // Assert
            Assert.Throws <NotImplementedException>(() => getGregorianYearTarget(target, 0, 0));
            Assert.Throws <FallthroughException>(() => getGregorianYearTarget(new JapaneseLunisolarCalendar(), 0, 0));
            Assert.Throws <NotImplementedException>(() => getYearInfoTarget(target, 0, 0));
            Assert.Throws <FallthroughException>(() => getYearInfoTarget(new JapaneseLunisolarCalendar(), 0, 0));
        }
Exemplo n.º 2
0
 public InstanceBehaviorSetting(PProxyJapaneseLunisolarCalendar @this)
 {
     m_this = @this;
 }