Exemplo n.º 1
0
        public void BasicEnumTest(Type type, object value, string expected)
        {
            var serializer = new SourceCodeSerializer();
            var converter  = new EnumConverter();
            var result     = converter.ConvertToExpression(type, value, serializer);

            _helper.WriteLine($"Expected: {expected}");
            _helper.WriteLine($"Result: {result}");

            Assert.Equal(expected, result.ToString());
        }
Exemplo n.º 2
0
        public void BasicEnumTestWithUsing(Type type, object value, string expected)
        {
            var settings = new SerializerSettings
            {
                Usings = ImmutableArray.Create("SourceCodeSerializer")
            };
            var serializer = new SourceCodeSerializer(settings);
            var converter  = new EnumConverter();
            var result     = converter.ConvertToExpression(type, value, serializer);

            _helper.WriteLine($"Expected: {expected}");
            _helper.WriteLine($"Result: {result}");

            Assert.Equal(expected, result.ToString());
        }