Exemple #1
0
 public void InitializeThrowsArgumentNullExceptionWhenGenerationEnvironmentIsNull()
 {
     using (var transformation = new FakeTransformation())
     {
         TransformationContext.Initialize(transformation, null);
     }
 }
Exemple #2
0
 public void InitializeThrowsArgumentExceptionWhenTransformationIsNotHostSpecific()
 {
     using (var transformation = new HostNeutralTransformation())
     {
         TransformationContext.Initialize(transformation, transformation.GenerationEnvironment);
     }
 }
Exemple #3
0
 public void InitializeThrowsArgumentExceptionWhenTransformationHostIsNull()
 {
     using (var transformation = new FakeTransformation())
     {
         transformation.Host = null;
         TransformationContext.Initialize(transformation, transformation.GenerationEnvironment);
     }
 }
Exemple #4
0
 public void CleanupRemovesCurrent()
 {
     using (var transformation = new FakeTransformation())
     {
         TransformationContext.Initialize(transformation, transformation.GenerationEnvironment);
         TransformationContext.Cleanup();
         var value = TransformationContext.Current;
     }
 }
Exemple #5
0
 public void InitializeSetsCurrent()
 {
     using (var transformation = new FakeTransformation())
     {
         TransformationContext.Initialize(transformation, transformation.GenerationEnvironment);
         try
         {
             Assert.IsNotNull(TransformationContext.Current);
         }
         finally
         {
             TransformationContext.Cleanup();
         }
     }
 }
Exemple #6
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);
            }
        }
Exemple #7
0
 public void InitializeThrowsArgumentNullExceptionWhenTransformationIsNull()
 {
     TransformationContext.Initialize(null, new StringBuilder());
 }
Exemple #8
0
 public TemplateTest()
 {
     this.transformation = new FakeTransformation();
     TransformationContext.Initialize(this.transformation, this.transformation.GenerationEnvironment);
 }