public void SutIsSpecimenBuilder()
 {
     // Fixture setup
     // Exercise system
     var sut = new Int32SequenceGenerator();
     // Verify outcome
     Assert.IsAssignableFrom<ISpecimenBuilder>(sut);
     // Teardown
 }
 public void CreateWithNullContainerDoesNotThrow()
 {
     // Fixture setup
     var sut = new Int32SequenceGenerator();
     // Exercise system
     var dummyRequest = new object();
     sut.Create(dummyRequest, null);
     // Verify outcome (no exception indicates success)
     // Teardown
 }
 public void CreateWithNullRequestWillReturnCorrectResult()
 {
     // Fixture setup
     var sut = new Int32SequenceGenerator();
     // Exercise system
     var dummyContainer = new DelegatingSpecimenContext();
     var result = sut.Create(null, dummyContainer);
     // Verify outcome
     Assert.Equal(new NoSpecimen(), result);
     // Teardown
 }
Ejemplo n.º 4
0
 public void CreateDoubleMixedParameterizedTypeWithNumberBasedStringGenerator()
 {
     // Fixture setup
     var intGenerator = new Int32SequenceGenerator();
     var builder = new CompositeSpecimenBuilder(
         intGenerator,
         new StringGenerator(() => intGenerator.CreateAnonymous()),
         new Int64SequenceGenerator(),
         new DecimalSequenceGenerator(),
         new BooleanSwitch(),
         new GuidGenerator(),
         new MethodInvoker(new ModestConstructorQuery()),
         new ParameterRequestRelay(),
         new StringSeedRelay(),
         new SeedIgnoringRelay());
     var container = new SpecimenContext(builder);
     // Exercise system
     var result = (TripleParameterType<int, string, int>)container.Resolve(typeof(TripleParameterType<int, string, int>));
     // Verify outcome
     Assert.Equal(1, result.Parameter1);
     Assert.Equal("parameter22", result.Parameter2);
     Assert.Equal(3, result.Parameter3);
     // Teardown
 }
        public void CreateWithNonInt32RequestWillReturnCorrectResult()
        {
            // Fixture setup
            var nonInt32Request = new object();
            var sut = new Int32SequenceGenerator();
            // Exercise system
            var dummyContainer = new DelegatingSpecimenContext();
            var result = sut.Create(nonInt32Request, dummyContainer);
            // Verify outcome
#pragma warning disable 618
            var expectedResult = new NoSpecimen(nonInt32Request);
#pragma warning restore 618
            Assert.Equal(expectedResult, result);
            // Teardown
        }