public void GetTypeName_RefGenericParameter() { var target = new CSharpTypeNameProvider(); var actual = target.GetTypeName(typeof(ISample).GetMethod("MethodWithGenericRefParameter").GetParameters().First().ParameterType); actual.Should().Be("IEnumerable<int>"); }
public void GetTypeName_OutBooleanParameter() { var target = new CSharpTypeNameProvider(); var actual = target.GetTypeName(typeof(ISample).GetMethod("MethodWithOutBooleanParameter").GetParameters().First().ParameterType); actual.Should().Be("bool"); }
public void GetTypeName_RefSimpleParameter() { var target = new CSharpTypeNameProvider(); var actual = target.GetTypeName(typeof(ISample).GetMethod("MethodWithSimpleRefParameter").GetParameters().First().ParameterType); actual.Should().Be("SampleClass"); }
public void GetTypeName_PointerSimpleParameter() { var target = new CSharpTypeNameProvider(); var actual = target.GetTypeName(typeof(char *)); actual.Should().Be("char*"); }
public void GetTypeName_JaggedArrayOfPrimitives() { var target = new CSharpTypeNameProvider(); var actual = target.GetTypeName(typeof(int[][])); actual.Should().Be("int[][]"); }
public void GetTypeName_JaggedArrayOfGenericTypes() { var target = new CSharpTypeNameProvider(); var actual = target.GetTypeName(typeof(IEnumerable <double>[][])); actual.Should().Be("IEnumerable<double>[][]"); }
public void GetTypeName_RefType() { var target = new CSharpTypeNameProvider(); var actual = target.GetTypeName(typeof(SampleClass)); actual.Should().Be("SampleClass"); }
public void GetTypeName_MultidimensionalArrayOfRefTypes() { var target = new CSharpTypeNameProvider(); var actual = target.GetTypeName(typeof(SampleClass[, , ])); actual.Should().Be("SampleClass[,,]"); }
public void GetTypeName_Char() { var target = new CSharpTypeNameProvider(); var actual = target.GetTypeName(typeof(char)); actual.Should().Be("char"); }
public void GetTypeName_NullableLong() { var target = new CSharpTypeNameProvider(); var actual = target.GetTypeName(typeof(long?)); actual.Should().Be("long?"); }
public void GetTypeName_NullableInt() { var target = new CSharpTypeNameProvider(); var actual = target.GetTypeName(typeof(int?)); actual.Should().Be("int?"); }
public void GetTypeName_NullableSByte() { var target = new CSharpTypeNameProvider(); var actual = target.GetTypeName(typeof(sbyte?)); actual.Should().Be("sbyte?"); }
public void GetTypeName_Void() { var target = new CSharpTypeNameProvider(); var actual = target.GetTypeName(typeof(void)); actual.Should().Be("void"); }
public void GetTypeName_Object() { var target = new CSharpTypeNameProvider(); var actual = target.GetTypeName(typeof(object)); actual.Should().Be("object"); }
public void GetTypeName_NullableValueType() { var target = new CSharpTypeNameProvider(); var actual = target.GetTypeName(typeof(SampleStruct?)); actual.Should().Be("SampleStruct?"); }
public void GetTypeName_MultidimensionalArrayOfPrimitives() { var target = new CSharpTypeNameProvider(); var actual = target.GetTypeName(typeof(int[, ])); actual.Should().Be("int[,]"); }
public void GetTypeName_GenericTypeWithMultipleParameters() { var target = new CSharpTypeNameProvider(); var actual = target.GetTypeName(typeof(Dictionary <string, double>)); actual.Should().Be("Dictionary<string, double>"); }
public void GetTypeName_MultidimensionalArrayOfGenericTypes() { var target = new CSharpTypeNameProvider(); var actual = target.GetTypeName(typeof(IEnumerable <double> [, , ])); actual.Should().Be("IEnumerable<double>[,,]"); }
public void GetTypeName_GenericTypeOfGenericType() { var target = new CSharpTypeNameProvider(); var actual = target.GetTypeName(typeof(List <IEnumerable <int> >)); actual.Should().Be("List<IEnumerable<int>>"); }
public void GetTypeName_Float() { var target = new CSharpTypeNameProvider(); var actual = target.GetTypeName(typeof(float)); actual.Should().Be("float"); }
public void GetTypeName_ArrayOfGenericTypes() { var target = new CSharpTypeNameProvider(); var actual = target.GetTypeName(typeof(List <int>[])); actual.Should().Be("List<int>[]"); }
public void GetTypeName_ULong() { var target = new CSharpTypeNameProvider(); var actual = target.GetTypeName(typeof(ulong)); actual.Should().Be("ulong"); }
public void GetTypeName_Short() { var target = new CSharpTypeNameProvider(); var actual = target.GetTypeName(typeof(short)); actual.Should().Be("short"); }
public void GetTypeName_Byte() { var target = new CSharpTypeNameProvider(); var actual = target.GetTypeName(typeof(byte)); actual.Should().Be("byte"); }
public void GetTypeName_UInt() { var target = new CSharpTypeNameProvider(); var actual = target.GetTypeName(typeof(uint)); actual.Should().Be("uint"); }
public void GetTypeName_Decimal() { var target = new CSharpTypeNameProvider(); var actual = target.GetTypeName(typeof(decimal)); actual.Should().Be("decimal"); }
public void GetTypeName_Double() { var target = new CSharpTypeNameProvider(); var actual = target.GetTypeName(typeof(double)); actual.Should().Be("double"); }
public void IncludeNamespace_WithGenericType() { var target = new CSharpTypeNameProvider() { IncludeNamespace = true }; var actual = target.GetTypeName(typeof(List <int>)); actual.Should().Be("System.Collections.Generic.List<int>"); }
public void IncludeNamespace_IsSet_IgnoreForAlias() { var target = new CSharpTypeNameProvider(); target.IncludeNamespace = true; var str = target.GetTypeName(typeof(int)); str.Should().Be("int"); }
public void IncludeNamespace_IsSet_Works() { var target = new CSharpTypeNameProvider(); target.IncludeNamespace = true; var actualType = this.GetType(); var str = target.GetTypeName(actualType); str.Should().Be(actualType.Namespace + "." + actualType.Name); }