public void CleanupRemovesCurrent() { using (var transformation = new FakeTransformation()) { TransformationContext.Initialize(transformation, transformation.GenerationEnvironment); TransformationContext.Cleanup(); var value = TransformationContext.Current; } }
public void Dispose() { if (this.transformation != null) { TransformationContext.Cleanup(); this.transformation.Dispose(); this.transformation = null; } }
public void InitializeSetsCurrent() { using (var transformation = new FakeTransformation()) { TransformationContext.Initialize(transformation, transformation.GenerationEnvironment); try { Assert.IsNotNull(TransformationContext.Current); } finally { TransformationContext.Cleanup(); } } }
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); } }
public void CleanupDoesNotThrowExceptionsWhenContextIsNullBecauseTheyWouldObscureInitializationExceptions() { TransformationContext.Cleanup(); }
public void Dispose() { TransformationContext.Cleanup(); this.transformation.Dispose(); }