Exemplo n.º 1
0
 public void GetServiceReturnsNullWhenServiceIsNotAvailable()
 {
     using (var transformation = new FakeTransformation())
         using (var context = new TransformationContext(transformation, transformation.GenerationEnvironment))
         {
             Assert.IsNull(context.GetService(typeof(ICloneable))); // Bogus service
         }
 }
Exemplo n.º 2
0
 public void GetServiceDelegatesToHost()
 {
     using (var transformation = new FakeTransformation())
         using (var context = new TransformationContext(transformation, transformation.GenerationEnvironment))
         {
             var expected = ((IServiceProvider)transformation.Host).GetService(typeof(ITransformationContextProvider));
             var actual   = context.GetService(typeof(ITransformationContextProvider));
             Assert.AreSame(expected, actual);
         }
 }
 public void GetServiceReturnsNullWhenServiceIsNotAvailable()
 {
     using (var transformation = new FakeTransformation())
     using (var context = new TransformationContext(transformation, transformation.GenerationEnvironment))
     {
         Assert.IsNull(context.GetService(typeof(ICloneable))); // Bogus service
     }
 }
 public void GetServiceDelegatesToHost()
 {
     using (var transformation = new FakeTransformation())
     using (var context = new TransformationContext(transformation, transformation.GenerationEnvironment))
     {
         var expected = ((IServiceProvider)transformation.Host).GetService(typeof(ITransformationContextProvider));
         var actual = context.GetService(typeof(ITransformationContextProvider));
         Assert.AreSame(expected, actual);
     }
 }