public void EmptyDataTest()
        {
            var generator = new GenericArgumentsGenerator();
            var result    = generator.Generate(new IGenericArgument[0]);

            Assert.AreEqual("", result);
        }
        public void StandardArgumentTest()
        {
            var generator = new GenericArgumentsGenerator();

            var genericArguments = new[] { new GenericArgument {
                                               Type = GenericArgumentType.Standard, Name = "T"
                                           } };
            var result = generator.Generate(genericArguments);

            Assert.AreEqual("T", result);
        }
        public void ContravariantArgumentTest()
        {
            var generator = new GenericArgumentsGenerator();

            var genericArguments = new[] { new GenericArgument {
                                               Type = GenericArgumentType.Contravariant, Name = "T"
                                           } };
            var result = generator.Generate(genericArguments);

            Assert.AreEqual("in T", result);
        }
        public void MultipleStandardArgumentsTest()
        {
            var generator = new GenericArgumentsGenerator();

            var genericArguments = new[]
            {
                new GenericArgument {
                    Type = GenericArgumentType.Standard, Name = "T1"
                },
                new GenericArgument {
                    Type = GenericArgumentType.Standard, Name = "T2"
                },
            };
            var result = generator.Generate(genericArguments);

            Assert.AreEqual("T1, T2", result);
        }
        public void MultipleArgumentsTest()
        {
            var generator = new GenericArgumentsGenerator();

            var genericArguments = new[]
            {
                new GenericArgument {
                    Type = GenericArgumentType.Standard, Name = "T1"
                },
                new GenericArgument {
                    Type = GenericArgumentType.Covariant, Name = "T2"
                },
                new GenericArgument {
                    Type = GenericArgumentType.Contravariant, Name = "T3"
                },
            };
            var result = generator.Generate(genericArguments);

            Assert.AreEqual("T1, out T2, in T3", result);
        }
        public void InvalidDataTypeTest()
        {
            var generator = new GenericArgumentsGenerator();

            Assert.Throws(typeof(InvalidOperationException), () => generator.Generate("Invalid"));
        }
        public void NullDataTest()
        {
            var generator = new GenericArgumentsGenerator();

            Assert.Throws(typeof(ArgumentNullException), () => generator.Generate(null));
        }