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)); }
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)); }
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))); }