Exemplo n.º 1
0
        public void GivenContentSerializerNameAttribute_WhenGetPropertyName_ThenReturnsOverridenName()
        {
            var page = new PropertyNameStrategyPage();

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

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

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

            result.ShouldBe("Heading");
        }