static SerializerRepresentationTest()
        {
            ConstructorArgumentValidationTestScenarios
            .RemoveAllScenarios()
            .AddScenario(() =>
                         new ConstructorArgumentValidationTestScenario <SerializerRepresentation>
            {
                Name             = "constructor should throw ArgumentException when parameter 'serializationKind' is SerializationKind.Invalid scenario",
                ConstructionFunc = () =>
                {
                    var referenceObject = A.Dummy <SerializerRepresentation>();

                    var result = new SerializerRepresentation(
                        SerializationKind.Invalid,
                        A.Dummy <TypeRepresentation>(),
                        referenceObject.CompressionKind,
                        referenceObject.Metadata);

                    return(result);
                },
                ExpectedExceptionType            = typeof(ArgumentOutOfRangeException),
                ExpectedExceptionMessageContains = new[] { "serializationKind", "Invalid" },
            })
            .AddScenario(() =>
                         new ConstructorArgumentValidationTestScenario <SerializerRepresentation>
            {
                Name             = "constructor should throw ArgumentException when parameter 'compressionKind' is CompressionKind.Invalid scenario",
                ConstructionFunc = () =>
                {
                    var referenceObject = A.Dummy <SerializerRepresentation>();

                    var result = new SerializerRepresentation(
                        referenceObject.SerializationKind,
                        A.Dummy <TypeRepresentation>(),
                        CompressionKind.Invalid,
                        referenceObject.Metadata);

                    return(result);
                },
                ExpectedExceptionType            = typeof(ArgumentOutOfRangeException),
                ExpectedExceptionMessageContains = new[] { "compressionKind", "Invalid" },
            });

            ConstructorPropertyAssignmentTestScenarios
            .AddScenario(() =>
                         new ConstructorPropertyAssignmentTestScenario <SerializerRepresentation>
            {
                Name = "ConfigurationTypeRepresentation should return null passed to constructor parameter 'serializationConfigType' when getting",
                SystemUnderTestExpectedPropertyValueFunc = () =>
                {
                    var referenceObject = A.Dummy <SerializerRepresentation>();

                    var result = new SystemUnderTestExpectedPropertyValue <SerializerRepresentation>
                    {
                        SystemUnderTest = new SerializerRepresentation(
                            referenceObject.SerializationKind,
                            null,
                            referenceObject.CompressionKind,
                            referenceObject.Metadata),
                        ExpectedPropertyValue = null,
                    };

                    return(result);
                },
                PropertyName = nameof(SerializerRepresentation.SerializationConfigType),
            })
            .AddScenario(() =>
                         new ConstructorPropertyAssignmentTestScenario <SerializerRepresentation>
            {
                Name = "Metadata should return empty Dictionary<string, string> when null is passed to constructor parameter 'metadata' when getting",
                SystemUnderTestExpectedPropertyValueFunc = () =>
                {
                    var referenceObject = A.Dummy <SerializerRepresentation>();

                    var result = new SystemUnderTestExpectedPropertyValue <SerializerRepresentation>
                    {
                        SystemUnderTest = new SerializerRepresentation(
                            referenceObject.SerializationKind,
                            referenceObject.SerializationConfigType,
                            referenceObject.CompressionKind,
                            null),
                        ExpectedPropertyValue = new Dictionary <string, string>(),
                    };

                    return(result);
                },
                PropertyName = nameof(SerializerRepresentation.Metadata),
                CompareActualToExpectedUsing = CompareActualToExpectedUsing.ValueEquality,
            });
        }
        static TypeRepresentationTest()
        {
            ConstructorArgumentValidationTestScenarios
            .RemoveAllScenarios()
            .AddScenario(() =>
                         new ConstructorArgumentValidationTestScenario <TypeRepresentation>
            {
                Name             = "constructor should throw ArgumentNullException when parameter 'namespace' is null scenario",
                ConstructionFunc = () =>
                {
                    var referenceObject = A.Dummy <TypeRepresentation>();

                    var result = new TypeRepresentation(
                        null,
                        referenceObject.Name,
                        referenceObject.AssemblyName,
                        referenceObject.AssemblyVersion,
                        referenceObject.GenericArguments);

                    return(result);
                },
                ExpectedExceptionType            = typeof(ArgumentNullException),
                ExpectedExceptionMessageContains = new[] { "namespace" },
            })
            .AddScenario(() =>
                         new ConstructorArgumentValidationTestScenario <TypeRepresentation>
            {
                Name             = "constructor should throw ArgumentException when parameter 'namespace' is white space scenario",
                ConstructionFunc = () =>
                {
                    var referenceObject = A.Dummy <TypeRepresentation>();

                    var result = new TypeRepresentation(
                        Invariant($"  {Environment.NewLine}  "),
                        referenceObject.Name,
                        referenceObject.AssemblyName,
                        referenceObject.AssemblyVersion,
                        referenceObject.GenericArguments);

                    return(result);
                },
                ExpectedExceptionType            = typeof(ArgumentException),
                ExpectedExceptionMessageContains = new[] { "namespace", "white space" },
            })
            .AddScenario(() =>
                         new ConstructorArgumentValidationTestScenario <TypeRepresentation>
            {
                Name             = "constructor should throw ArgumentNullException when parameter 'name' is null scenario",
                ConstructionFunc = () =>
                {
                    var referenceObject = A.Dummy <TypeRepresentation>();

                    var result = new TypeRepresentation(
                        referenceObject.Namespace,
                        null,
                        referenceObject.AssemblyName,
                        referenceObject.AssemblyVersion,
                        referenceObject.GenericArguments);

                    return(result);
                },
                ExpectedExceptionType            = typeof(ArgumentNullException),
                ExpectedExceptionMessageContains = new[] { "name" },
            })
            .AddScenario(() =>
                         new ConstructorArgumentValidationTestScenario <TypeRepresentation>
            {
                Name             = "constructor should throw ArgumentException when parameter 'name' is white space scenario",
                ConstructionFunc = () =>
                {
                    var referenceObject = A.Dummy <TypeRepresentation>();

                    var result = new TypeRepresentation(
                        referenceObject.Namespace,
                        Invariant($"  {Environment.NewLine}  "),
                        referenceObject.AssemblyName,
                        referenceObject.AssemblyVersion,
                        referenceObject.GenericArguments);

                    return(result);
                },
                ExpectedExceptionType            = typeof(ArgumentException),
                ExpectedExceptionMessageContains = new[] { "name", "white space" },
            })
            .AddScenario(() =>
                         new ConstructorArgumentValidationTestScenario <TypeRepresentation>
            {
                Name             = "constructor should throw ArgumentNullException when parameter 'assemblyName' is null scenario",
                ConstructionFunc = () =>
                {
                    var referenceObject = A.Dummy <TypeRepresentation>();

                    var result = new TypeRepresentation(
                        referenceObject.Namespace,
                        referenceObject.Name,
                        null,
                        referenceObject.AssemblyVersion,
                        referenceObject.GenericArguments);

                    return(result);
                },
                ExpectedExceptionType            = typeof(ArgumentNullException),
                ExpectedExceptionMessageContains = new[] { "assemblyName" },
            })
            .AddScenario(() =>
                         new ConstructorArgumentValidationTestScenario <TypeRepresentation>
            {
                Name             = "constructor should throw ArgumentException when parameter 'assemblyName' is white space scenario",
                ConstructionFunc = () =>
                {
                    var referenceObject = A.Dummy <TypeRepresentation>();

                    var result = new TypeRepresentation(
                        referenceObject.Namespace,
                        referenceObject.Name,
                        Invariant($"  {Environment.NewLine}  "),
                        referenceObject.AssemblyVersion,
                        referenceObject.GenericArguments);

                    return(result);
                },
                ExpectedExceptionType            = typeof(ArgumentException),
                ExpectedExceptionMessageContains = new[] { "assemblyName", "white space" },
            })
            .AddScenario(() =>
                         new ConstructorArgumentValidationTestScenario <TypeRepresentation>
            {
                Name             = "constructor should throw ArgumentException when parameter 'assemblyVersion' is white space scenario",
                ConstructionFunc = () =>
                {
                    var referenceObject = A.Dummy <TypeRepresentation>();

                    var result = new TypeRepresentation(
                        referenceObject.Namespace,
                        referenceObject.Name,
                        referenceObject.AssemblyName,
                        Invariant($"  {Environment.NewLine}  "),
                        referenceObject.GenericArguments);

                    return(result);
                },
                ExpectedExceptionType            = typeof(ArgumentException),
                ExpectedExceptionMessageContains = new[] { "assemblyVersion", "white space" },
            })
            .AddScenario(() =>
                         new ConstructorArgumentValidationTestScenario <TypeRepresentation>
            {
                Name             = "constructor should throw ArgumentException when parameter 'genericArguments' contains a null element scenario",
                ConstructionFunc = () =>
                {
                    var referenceObject = A.Dummy <TypeRepresentation>().ThatIs(_ => _.IsClosedGenericType());

                    var result = new TypeRepresentation(
                        referenceObject.Namespace,
                        referenceObject.Name,
                        referenceObject.AssemblyName,
                        referenceObject.AssemblyVersion,
                        new TypeRepresentation[0].Concat(referenceObject.GenericArguments).Concat(new TypeRepresentation[] { null }).Concat(referenceObject.GenericArguments).ToList());

                    return(result);
                },
                ExpectedExceptionType            = typeof(ArgumentException),
                ExpectedExceptionMessageContains = new[] { "genericArguments", "contains at least one null element" },
            });

            ConstructorPropertyAssignmentTestScenarios
            .AddScenario(() =>
                         new ConstructorPropertyAssignmentTestScenario <TypeRepresentation>
            {
                Name = "GenericArguments should return null, when 'genericArguments' parameter passed to constructor is null, when getting",
                SystemUnderTestExpectedPropertyValueFunc = () =>
                {
                    var referenceObject = A.Dummy <TypeRepresentation>();

                    var result = new SystemUnderTestExpectedPropertyValue <TypeRepresentation>
                    {
                        SystemUnderTest = new TypeRepresentation(
                            referenceObject.Namespace,
                            referenceObject.Name,
                            referenceObject.AssemblyName,
                            referenceObject.AssemblyVersion,
                            null),
                        ExpectedPropertyValue = null,
                    };

                    return(result);
                },
                PropertyName = "GenericArguments",
            });

            StringRepresentationTestScenarios
            .AddScenario(() =>
                         new StringRepresentationTestScenario <TypeRepresentation>
            {
                Name = "ToString should return the same string as BuildAssemblyQualifiedName() when called",
                SystemUnderTestExpectedStringRepresentationFunc = () =>
                {
                    var systemUnderTest = A.Dummy <TypeRepresentation>();

                    var result = new SystemUnderTestExpectedStringRepresentation <TypeRepresentation>
                    {
                        SystemUnderTest = systemUnderTest,
                        ExpectedStringRepresentation = systemUnderTest.BuildAssemblyQualifiedName(),
                    };

                    return(result);
                },
            })
            .AddScenario(() =>
                         new StringRepresentationTestScenario <TypeRepresentation>
            {
                Name = "ToString should return the Assembly Qualified Name when called",
                SystemUnderTestExpectedStringRepresentationFunc = () =>
                {
                    var systemUnderTest = typeof(IReadOnlyCollection <string> [, ]).ToRepresentation();

                    var result = new SystemUnderTestExpectedStringRepresentation <TypeRepresentation>
                    {
                        SystemUnderTest = systemUnderTest,
                        ExpectedStringRepresentation = "System.Collections.Generic.IReadOnlyCollection`1[[System.String, mscorlib, Version=4.0.0.0]][,], mscorlib, Version=4.0.0.0",
                    };

                    return(result);
                },
            });
        }