<commit_before>﻿using Shouldly;
using Xunit;

namespace AutoMapper.UnitTests
{
    namespace ValueTransformers
    {
        public class BasicTransforming : AutoMapperSpecBase
        {
            public class Source
            {
                public string Value { get; set; }
            }

            public class Dest
            {
                public string Value { get; set; }
            }

            protected override MapperConfiguration Configuration { get; } = new MapperConfiguration(cfg =>
            {
                cfg.CreateMap<Source, Dest>();
                cfg.ApplyTransform<string>(dest => dest + " is straight up dope");
            });

            [Fact]
            public void Should_transform_value()
            {
                var source = new Source
                {
                    Value = "Jimmy"
                };
                var dest = Mapper.Map<Source, Dest>(source);

                dest.Value.ShouldBe("Jimmy is straight up dope");
            }
        }

        public class StackingTransformers : AutoMapperSpecBase
        {
            public class Source
            {
                public string Value { get; set; }
            }

            public class Dest
            {
                public string Value { get; set; }
            }

            protected override MapperConfiguration Configuration { get; } = new MapperConfiguration(cfg =>
            {
                cfg.CreateMap<Source, Dest>();
                cfg.ApplyTransform<string>(dest => dest + " is straight up dope");
                cfg.ApplyTransform<string>(dest => dest + "! No joke!");
            });

            [Fact]
            public void Should_stack_transformers_in_order()
            {
                var source = new Source
                {
                    Value = "Jimmy"
                };
                var dest = Mapper.Map<Source, Dest>(source);

                dest.Value.ShouldBe("Jimmy is straight up dope! No joke!");
            }
        }

        public class DifferentProfiles : AutoMapperSpecBase
        {
            public class Source
            {
                public string Value { get; set; }
            }

            public class Dest
            {
                public string Value { get; set; }
            }

            protected override MapperConfiguration Configuration { get; } = new MapperConfiguration(cfg =>
            {
                cfg.CreateMap<Source, Dest>();
                cfg.ApplyTransform<string>(dest => dest + " is straight up dope");
                cfg.CreateProfile("Other", p => p.ApplyTransform<string>(dest => dest + "! No joke!"));
            });

            [Fact]
            public void Should_not_apply_other_transform()
            {
                var source = new Source
                {
                    Value = "Jimmy"
                };
                var dest = Mapper.Map<Source, Dest>(source);

                dest.Value.ShouldBe("Jimmy is straight up dope");
            }
        }

        public class StackingRootConfigAndProfileTransform : AutoMapperSpecBase
        {
            public class Source
            {
                public string Value { get; set; }
            }

            public class Dest
            {
                public string Value { get; set; }
            }

            protected override MapperConfiguration Configuration { get; } = new MapperConfiguration(cfg =>
            {
                cfg.ApplyTransform<string>(dest => dest + "! No joke!");
                cfg.CreateProfile("Other", p =>
                {
                    p.CreateMap<Source, Dest>();
                    p.ApplyTransform<string>(dest => dest + " is straight up dope");
                });
            });

            [Fact]
            public void ShouldApplyProfileFirstThenRoot()
            {
                var source = new Source
                {
                    Value = "Jimmy"
                };
                var dest = Mapper.Map<Source, Dest>(source);

                dest.Value.ShouldBe("Jimmy is straight up dope! No joke!");
            }
        }

    }
}<commit_msg>Adding test for value types<commit_after>﻿using Shouldly;
using Xunit;

namespace AutoMapper.UnitTests
{
    namespace ValueTransformers
    {
        public class BasicTransforming : AutoMapperSpecBase
        {
            public class Source
            {
                public string Value { get; set; }
            }

            public class Dest
            {
                public string Value { get; set; }
            }

            protected override MapperConfiguration Configuration { get; } = new MapperConfiguration(cfg =>
            {
                cfg.CreateMap<Source, Dest>();
                cfg.ApplyTransform<string>(dest => dest + " is straight up dope");
            });

            [Fact]
            public void Should_transform_value()
            {
                var source = new Source
                {
                    Value = "Jimmy"
                };
                var dest = Mapper.Map<Source, Dest>(source);

                dest.Value.ShouldBe("Jimmy is straight up dope");
            }
        }

        public class StackingTransformers : AutoMapperSpecBase
        {
            public class Source
            {
                public string Value { get; set; }
            }

            public class Dest
            {
                public string Value { get; set; }
            }

            protected override MapperConfiguration Configuration { get; } = new MapperConfiguration(cfg =>
            {
                cfg.CreateMap<Source, Dest>();
                cfg.ApplyTransform<string>(dest => dest + " is straight up dope");
                cfg.ApplyTransform<string>(dest => dest + "! No joke!");
            });

            [Fact]
            public void Should_stack_transformers_in_order()
            {
                var source = new Source
                {
                    Value = "Jimmy"
                };
                var dest = Mapper.Map<Source, Dest>(source);

                dest.Value.ShouldBe("Jimmy is straight up dope! No joke!");
            }
        }

        public class DifferentProfiles : AutoMapperSpecBase
        {
            public class Source
            {
                public string Value { get; set; }
            }

            public class Dest
            {
                public string Value { get; set; }
            }

            protected override MapperConfiguration Configuration { get; } = new MapperConfiguration(cfg =>
            {
                cfg.CreateMap<Source, Dest>();
                cfg.ApplyTransform<string>(dest => dest + " is straight up dope");
                cfg.CreateProfile("Other", p => p.ApplyTransform<string>(dest => dest + "! No joke!"));
            });

            [Fact]
            public void Should_not_apply_other_transform()
            {
                var source = new Source
                {
                    Value = "Jimmy"
                };
                var dest = Mapper.Map<Source, Dest>(source);

                dest.Value.ShouldBe("Jimmy is straight up dope");
            }
        }

        public class StackingRootConfigAndProfileTransform : AutoMapperSpecBase
        {
            public class Source
            {
                public string Value { get; set; }
            }

            public class Dest
            {
                public string Value { get; set; }
            }

            protected override MapperConfiguration Configuration { get; } = new MapperConfiguration(cfg =>
            {
                cfg.ApplyTransform<string>(dest => dest + "! No joke!");
                cfg.CreateProfile("Other", p =>
                {
                    p.CreateMap<Source, Dest>();
                    p.ApplyTransform<string>(dest => dest + " is straight up dope");
                });
            });

            [Fact]
            public void ShouldApplyProfileFirstThenRoot()
            {
                var source = new Source
                {
                    Value = "Jimmy"
                };
                var dest = Mapper.Map<Source, Dest>(source);

                dest.Value.ShouldBe("Jimmy is straight up dope! No joke!");
            }
        }

        public class TransformingValueTypes : AutoMapperSpecBase
        {
            public class Source
            {
                public int Value { get; set; }
            }

            public class Dest
            {
                public int Value { get; set; }
            }

            protected override MapperConfiguration Configuration { get; } = new MapperConfiguration(cfg =>
            {
                cfg.ApplyTransform<int>(dest => dest * 2);
                cfg.CreateProfile("Other", p =>
                {
                    p.CreateMap<Source, Dest>();
                    p.ApplyTransform<int>(dest => dest + 3);
                });
            });

            [Fact]
            public void ShouldApplyProfileFirstThenRoot()
            {
                var source = new Source
                {
                    Value = 5
                };
                var dest = Mapper.Map<Source, Dest>(source);

                dest.Value.ShouldBe((5 + 3) * 2);
            }
        }

    }
}
{'fraction_non_alphanumeric': 0.08657639407186267, 'fraction_numerical': 0.0006397270497920887, 'mean_word_length': 1.1642824180895246, 'pattern_counts': {'":': 0, '<': 37, '<?xml version=': 0, '>': 67, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '108981', 'n_tokens_mistral': 2237, 'n_tokens_neox': 2062, 'n_words': 546}