Exemplo n.º 1
0
        public void GetSafeTypeName_BuiltinTypeGiven_ShouldReturnShortenRepresentation()
        {
            var type = typeof(int);

            var result = CSharpSourceCodeGeneration.GetSafeTypeName(type);

            result.Should().Be("int");
        }
Exemplo n.º 2
0
        public void GetSafeTypeName_ArrayGiven_ShouldReturnArrayType()
        {
            var type = typeof(SampleClass[]);

            var result = CSharpSourceCodeGeneration.GetSafeTypeName(type);

            result.Should().Be("SampleClass[]");
        }
Exemplo n.º 3
0
        public void GetSafeTypeName_GenericGiven_ShouldReturnCorrespondingGenericExpression()
        {
            var type = typeof(Action <SampleStruct>);

            var result = CSharpSourceCodeGeneration.GetSafeTypeName(type);

            result.Should().Be("Action<SampleStruct>");
        }
Exemplo n.º 4
0
        public void GetSafeTypeName_ClassGiven_ShouldReturnClassName()
        {
            var type = typeof(SampleClass);

            var result = CSharpSourceCodeGeneration.GetSafeTypeName(type);

            result.Should().Be(type.Name);
        }