示例#1
0
        public void Decorator_GetInner_On_ContentNegotiatiorTracer_Returns_IContentNegotiator()
        {
            // Arrange
            IContentNegotiator      expectedInner    = new Mock <IContentNegotiator>().Object;
            ContentNegotiatorTracer productUnderTest = new ContentNegotiatorTracer(expectedInner, new TestTraceWriter());

            // Act
            IContentNegotiator actualInner = Decorator.GetInner(productUnderTest as IContentNegotiator);

            // Assert
            Assert.Same(expectedInner, actualInner);
        }
 public ContentNegotiatorTracerTest()
 {
     _tracer = new ContentNegotiatorTracer(_mockNegotiator.Object, _traceWriter);
 }
示例#3
0
 public ContentNegotiatorTracerTest()
 {
     _tracer = new ContentNegotiatorTracer(_mockNegotiator.Object, _traceWriter);
 }
示例#4
0
 private static void CreateContentNegotiatorTracer(HttpConfiguration configuration, ITraceWriter traceWriter)
 {
     IContentNegotiator negotiator = configuration.ServiceResolver.GetService(typeof(IContentNegotiator)) as IContentNegotiator;
     ContentNegotiatorTracer tracer = new ContentNegotiatorTracer(negotiator, traceWriter);
     configuration.ServiceResolver.SetService(typeof(IContentNegotiator), tracer);
 }
        public void Decorator_GetInner_On_ContentNegotiatiorTracer_Returns_IContentNegotiator()
        {
            // Arrange
            IContentNegotiator expectedInner = new Mock<IContentNegotiator>().Object;
            ContentNegotiatorTracer productUnderTest = new ContentNegotiatorTracer(expectedInner, new TestTraceWriter());

            // Act
            IContentNegotiator actualInner = Decorator.GetInner(productUnderTest as IContentNegotiator);

            // Assert
            Assert.Same(expectedInner, actualInner);
        }
 private static void CreateContentNegotiatorTracer(HttpConfiguration configuration, ITraceWriter traceWriter)
 {
     IContentNegotiator negotiator = configuration.Services.GetContentNegotiator();
     ContentNegotiatorTracer tracer = new ContentNegotiatorTracer(negotiator, traceWriter);
     configuration.Services.Replace(typeof(IContentNegotiator), tracer);
 }