Ejemplo n.º 1
0
 public void CleanupRemovesCurrent()
 {
     using (var transformation = new FakeTransformation())
     {
         TransformationContext.Initialize(transformation, transformation.GenerationEnvironment);
         TransformationContext.Cleanup();
         var value = TransformationContext.Current;
     }
 }
Ejemplo n.º 2
0
 public void Dispose()
 {
     if (this.transformation != null)
     {
         TransformationContext.Cleanup();
         this.transformation.Dispose();
         this.transformation = null;
     }
 }
Ejemplo n.º 3
0
 public void InitializeSetsCurrent()
 {
     using (var transformation = new FakeTransformation())
     {
         TransformationContext.Initialize(transformation, transformation.GenerationEnvironment);
         try
         {
             Assert.IsNotNull(TransformationContext.Current);
         }
         finally
         {
             TransformationContext.Cleanup();
         }
     }
 }
Ejemplo n.º 4
0
        public void CleanupDisposesCurrent()
        {
            using (var transformation = new FakeTransformation())
            {
                bool disposed = false;
                TransformationContext.Initialize(transformation, transformation.GenerationEnvironment);
                try
                {
                    TransformationContext.Current.Disposed += delegate { disposed = true; };
                }
                finally
                {
                    TransformationContext.Cleanup();
                }

                Assert.IsTrue(disposed);
            }
        }
Ejemplo n.º 5
0
 public void CleanupDoesNotThrowExceptionsWhenContextIsNullBecauseTheyWouldObscureInitializationExceptions()
 {
     TransformationContext.Cleanup();
 }
Ejemplo n.º 6
0
 public void Dispose()
 {
     TransformationContext.Cleanup();
     this.transformation.Dispose();
 }