Example #1
0
        public void AssemblyXmlDocumentationSource_GetDocumentationText_ReturnsNull_WhenXmlFileMissing()
        {
            // Use the test project as a reference without XML documentation file.
            var sut = new AssemblyXmlDocumentationSource();

            Assert.Null(sut.GetDocumentationText(typeof(AssemblyXmlDocumentationSourceTests)));
        }
Example #2
0
        public void AssemblyXmlDocumentationSource_GetDocumentationText_SupportsTypeDocumentation()
        {
            // Use the sample assembly.
            var assembly = Assembly.LoadFile(SampleAssemblyInfo.Location.FullName);
            var type     = assembly.GetType("Clr2Ts.Transpiler.Tests.SampleAssembly.SampleClass");

            var sut = new AssemblyXmlDocumentationSource();

            Assert.Equal("Sample class for unit tests.", sut.GetDocumentationText(type));
        }
Example #3
0
        public void AssemblyXmlDocumentationSource_GetDocumentationText_SupportsPropertyDocumentation()
        {
            // Use the sample assembly.
            var assembly = Assembly.LoadFile(SampleAssemblyInfo.Location.FullName);
            var type     = assembly.GetType("Clr2Ts.Transpiler.Tests.SampleAssembly.SampleClass");
            var property = type.GetProperty("SampleString");

            var sut = new AssemblyXmlDocumentationSource();

            Assert.Equal("Some sample string property.", sut.GetDocumentationText(property));
        }
Example #4
0
        public void AssemblyXmlDocumentationSource_GetDocumentationText_ThrowsException_WhenMemberNull()
        {
            var sut = new AssemblyXmlDocumentationSource();

            Assert.Throws <ArgumentNullException>(() => sut.GetDocumentationText(null));
        }