Esempio n. 1
0
        public void GivenContentSerializerNameAttribute_WhenGetPropertyName_ThenReturnsOverridenName()
        {
            var page = new DefaultPropertyNameStrategyPage();

            var result = this._sut.GetPropertyName(page.GetType().GetProperty(nameof(DefaultPropertyNameStrategyPage.Author)));

            result.ShouldBe("customAuthor");
        }
Esempio n. 2
0
        public void GivenNoContentSerializerNameAttribute_WhenGetPropertyName_ThenReturnsDeclaredName()
        {
            var page = new DefaultPropertyNameStrategyPage();

            var result = this._sut.GetPropertyName(page.GetType().GetProperty(nameof(DefaultPropertyNameStrategyPage.Heading)));

            result.ShouldBe("Heading");
        }