Esempio n. 1
0
        public void GenerateClassProxy_should_be_null_guarded()
        {
            // Arrange

            // Act

            // Assert
            Expression <Action> call = () => CastleDynamicProxyGenerator.GenerateClassProxy(typeof(AbstractClass), this.noAdditionalInterfaces, null, Enumerable.Empty <Expression <Func <Attribute> > >(), A.Dummy <IFakeCallProcessorProvider>());

            call.Should().BeNullGuarded();
        }
Esempio n. 2
0
        public void Should_ensure_fake_call_processor_is_initialized_but_not_fetched_when_no_method_on_fake_class_is_called(Type typeToProxy)
        {
            // Arrange
            var fakeCallProcessorProvider = A.Fake <IFakeCallProcessorProvider>();

            // Act
            CastleDynamicProxyGenerator.GenerateClassProxy(typeToProxy, this.noAdditionalInterfaces, null, Enumerable.Empty <Expression <Func <Attribute> > >(), fakeCallProcessorProvider);

            // Assert
            A.CallTo(() => fakeCallProcessorProvider.Fetch(A <object> ._)).MustNotHaveHappened();
            A.CallTo(() => fakeCallProcessorProvider.EnsureInitialized(A <object> ._)).MustHaveHappened();
        }