public void TransformNullBuilderThrows()
 {
     // Fixture setup
     var sut = new NullRecursionBehavior();
     // Exercise system and verify outcome
     Assert.Throws<ArgumentNullException>(() =>
         sut.Transform(null));
     // Teardown
 }
 public void SutIsSpecimenBuilderTransformation()
 {
     // Fixture setup
     // Exercise system
     var sut = new NullRecursionBehavior();
     // Verify outcome
     Assert.IsAssignableFrom<ISpecimenBuilderTransformation>(sut);
     // Teardown
 }
 public void TransformReturnsCorrectResult()
 {
     // Fixture setup
     var sut = new NullRecursionBehavior();
     // Exercise system
     var dummyBuilder = new DelegatingSpecimenBuilder();
     var result = sut.Transform(dummyBuilder);
     // Verify outcome
     Assert.IsAssignableFrom<NullRecursionGuard>(result);
     // Teardown
 }
 public void TranformResultCorrectlyDecoratesInput()
 {
     // Fixture setup
     var sut = new NullRecursionBehavior();
     var expectedBuilder = new DelegatingSpecimenBuilder();
     // Exercise system
     var result = sut.Transform(expectedBuilder);
     // Verify outcome
     var guard = Assert.IsAssignableFrom<RecursionGuard>(result);
     Assert.Equal(expectedBuilder, guard.Builder);
     // Teardown
 }
 public void TransformReturnsCorrectResultForDefaultRecursionDepth()
 {
     // Fixture setup
     var sut = new NullRecursionBehavior();
     // Exercise system
     var dummyBuilder = new DelegatingSpecimenBuilder();
     var result = sut.Transform(dummyBuilder);
     // Verify outcome
     var rg = Assert.IsAssignableFrom<RecursionGuard>(result);
     Assert.IsAssignableFrom<NullRecursionHandler>(rg.RecursionHandler);
     Assert.Equal(1, rg.RecursionDepth);
     // Teardown
 }