Ejemplo n.º 1
0
        public static void GetComment_WhenMemberFoundButNoSummaryPresent_ReturnsNull()
        {
            var type         = typeof(ReflectionCommentProvider);
            var fakeProvider = new FakeReflectionCommentProvider();
            var identifier   = fakeProvider.GetIdentifier(type);
            var doc          = XDocument.Parse($"<doc><member name=\"{ identifier }\"></member></doc>");
            var provider     = new ReflectionCommentProvider(doc);
            var comment      = provider.GetComment(type);

            Assert.That(comment, Is.Null);
        }
Ejemplo n.º 2
0
        public static void GetComment_WhenMemberAndSummaryPresent_ReturnsCorrectSummaryValue()
        {
            var          type         = typeof(ReflectionCommentProvider);
            var          fakeProvider = new FakeReflectionCommentProvider();
            var          identifier   = fakeProvider.GetIdentifier(type);
            const string testSummary  = "this is a test comment";
            var          doc          = XDocument.Parse($"<doc><member name=\"{ identifier }\"><summary>{ testSummary }</summary></member></doc>");
            var          provider     = new ReflectionCommentProvider(doc);
            var          comment      = provider.GetComment(type);

            Assert.That(comment, Is.EqualTo(testSummary));
        }