public void IServiceProviderExtensions_GetServiceOfTU_ReturnsServiceU()
        {
            // Act
            IOther actual = this.serviceProvider.GetService <IService, IOther>();

            // Assert
            actual.Should().NotBeNull();
            actual.Should().Be(this.serviceInstance);
        }
        public void IServiceProviderExtensions_GetServiceOfTU_ReturnsServiceU()
        {
            // Act
            IOther actual = this.serviceProvider.GetService <IService, IOther>();

            // Verify
            Assert.IsNotNull(actual);
            Assert.AreSame(this.serviceInstance, actual);
        }
Ejemplo n.º 3
0
        public void CanOnlyAddMethodInterceptors()
        {
            ProxyFactory factory = new ProxyFactory(new TestObject());

            factory.AddAdvice(0, new NopInterceptor());
            try
            {
                factory.AddAdvice(0, new AnonymousClassInterceptor());
                Assert.Fail("Should only be able to add MethodInterceptors");
            }
            catch (AopConfigException)
            {
            }

            // Check we can still use it
            IOther other = (IOther)factory.GetProxy();

            other.Absquatulate();
        }
Ejemplo n.º 4
0
 void RemoveOtherData(IOther data)
 {
 }