public void FromNullQuadrupleParameterFactoryThrows() { // Fixture setup var sut = new SutBuilder <GenericUriParser>().Create(); // Exercise system and verify outcome Assert.Throws <ArgumentNullException>(() => sut.FromFactory <int, DateTime, AttributeTargets, LoaderOptimization>(null)); // Teardown }
public void FromNullTripleParameterFactoryThrows() { // Fixture setup var sut = new SutBuilder <FileStyleUriParser>().Create(); // Exercise system and verify outcome Assert.Throws <ArgumentNullException>(() => sut.FromFactory <GenericUriParser, Base64FormattingOptions, LdapStyleUriParser>(null)); // Teardown }
public void FromNullDoubleParameterFactoryThrows() { // Fixture setup var sut = new SutBuilder <UnicodeEncoding>().Create(); // Exercise system and verify outcome Assert.Throws <ArgumentNullException>(() => sut.FromFactory <WeakReference, HttpStyleUriParser>(null)); // Teardown }
public void FromNullSingleParameterFactoryThrows() { // Fixture setup var sut = new SutBuilder <DateTimeKind>().Create(); // Exercise system and verify outcome Assert.Throws <ArgumentNullException>(() => sut.FromFactory <ObsoleteAttribute>(null)); // Teardown }
public void FromNullParameterlessFactoryThrows() { // Fixture setup var sut = new SutBuilder <Guid>().Create(); // Exercise system and verify outcome Assert.Throws <ArgumentNullException>(() => sut.FromFactory((Func <Guid>)null)); // Teardown }
public void FromBuilderFactoryReturnsCorrectResult() { // Fixture setup var expectedFactory = new DelegatingSpecimenBuilder(); var sut = new SutBuilder <Version>().Create(); // Exercise system var result = sut.FromFactory(expectedFactory); // Verify outcome var resultingComposer = Assert.IsAssignableFrom <Composer <Version> >(result); Assert.Equal(expectedFactory, resultingComposer.Factory); // Teardown }
public void FromQuadrupleInputFactoryReturnsCorrectResult() { // Fixture setup Func <Random, HttpStyleUriParser, LoaderOptimizationAttribute, Base64FormattingOptions, NetPipeStyleUriParser> expectedFactory = (x, y, z, æ) => new NetPipeStyleUriParser(); var sut = new SutBuilder <NetPipeStyleUriParser>().Create(); // Exercise system var result = sut.FromFactory(expectedFactory); // Verify outcome var resultingComposer = Assert.IsAssignableFrom <Composer <NetPipeStyleUriParser> >(result); var factory = Assert.IsAssignableFrom <SpecimenFactory <Random, HttpStyleUriParser, LoaderOptimizationAttribute, Base64FormattingOptions, NetPipeStyleUriParser> >(resultingComposer.Factory); Assert.Equal(expectedFactory, factory.Factory); // Teardown }
public void FromTripleInputFactoryReturnsCorrectResult() { // Fixture setup Func <HttpStyleUriParser, Random, ASCIIEncoding, string> expectedFactory = (x, y, z) => string.Empty; var sut = new SutBuilder <string>().Create(); // Exercise system var result = sut.FromFactory(expectedFactory); // Verify outcome var resultingComposer = Assert.IsAssignableFrom <Composer <string> >(result); var factory = Assert.IsAssignableFrom <SpecimenFactory <HttpStyleUriParser, Random, ASCIIEncoding, string> >(resultingComposer.Factory); Assert.Equal(expectedFactory, factory.Factory); // Teardown }
public void FromDoubleInputFactoryReturnsCorrectResult() { // Fixture setup Func <string, decimal, byte> expectedFactory = (x, y) => 0; var sut = new SutBuilder <byte>().Create(); // Exercise system var result = sut.FromFactory(expectedFactory); // Verify outcome var resultingComposer = Assert.IsAssignableFrom <Composer <byte> >(result); var factory = Assert.IsAssignableFrom <SpecimenFactory <string, decimal, byte> >(resultingComposer.Factory); Assert.Equal(expectedFactory, factory.Factory); // Teardown }
public void FromSingleInputFactoryReturnsCorrectResult() { // Fixture setup Func <Version, Uri> expectedFactory = v => new Uri("urn:" + v.ToString()); var sut = new SutBuilder <Uri>().Create(); // Exercise system var result = sut.FromFactory(expectedFactory); // Verify outcome var resultingComposer = Assert.IsAssignableFrom <Composer <Uri> >(result); var factory = Assert.IsAssignableFrom <SpecimenFactory <Version, Uri> >(resultingComposer.Factory); Assert.Equal(expectedFactory, factory.Factory); // Teardown }
public void FromZeroInputFactoryReturnsCorrectResult() { // Fixture setup Func <Uri> expectedFactory = () => new Uri("urn:anonymous:uri"); var sut = new SutBuilder <Uri>().Create(); // Exercise system var result = sut.FromFactory(expectedFactory); // Verify outcome var resultingComposer = Assert.IsAssignableFrom <Composer <Uri> >(result); var factory = Assert.IsAssignableFrom <SpecimenFactory <Uri> >(resultingComposer.Factory); Assert.Equal(expectedFactory, factory.Factory); // Teardown }