Esempio n. 1
0
        public void gets_type_name()
        {
            var names = new Dictionary<MemberInfo, string>();

            var sut = new NameProvider(names, "Anon");
            var type = typeof (Simple);

            Assert.Equal(type.Name, sut.Get(type));
        }
Esempio n. 2
0
        public void gets_property_name()
        {
            var names = new Dictionary<MemberInfo, string>();

            var sut = new NameProvider(names, "Anon");
            var propertyInfo = typeof (Simple).GetProperties().First();

            Assert.Equal(propertyInfo.Name, sut.Get(propertyInfo));
        }
Esempio n. 3
0
        public void overrides_type_name()
        {
            const string expectedName = "Egg";
            var names = new Dictionary<MemberInfo, string>
                            {
                                {typeof (Simple), expectedName}
                            };

            var sut = new NameProvider(names, "Anon");

            Assert.Equal(expectedName, sut.Get(typeof (Simple)));
        }