diff options
author | Mikhail Melnikov <mikhail_melnikov@epam.com> | 2018-05-12 18:18:44 +0300 |
---|---|---|
committer | Joel Martinez <joelmartinez@gmail.com> | 2018-05-30 00:22:41 +0300 |
commit | 111914edcbdf705aa44cfaeadabf343e3e3ea052 (patch) | |
tree | 13f0ce9ded804c9d3e0a8818179299689507fe9e /mdoc/mdoc.Test/DocUtilsFSharpTests.cs | |
parent | 047f5c951965c0a131d581c58eb2af0ba341c48d (diff) |
Fix check of ignored members
In `DocUtils.IsIgnored`, check if member is generated by a compiler before checking of prefixes
Closes #199
Diffstat (limited to 'mdoc/mdoc.Test/DocUtilsFSharpTests.cs')
-rw-r--r-- | mdoc/mdoc.Test/DocUtilsFSharpTests.cs | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/mdoc/mdoc.Test/DocUtilsFSharpTests.cs b/mdoc/mdoc.Test/DocUtilsFSharpTests.cs new file mode 100644 index 00000000..da518e3e --- /dev/null +++ b/mdoc/mdoc.Test/DocUtilsFSharpTests.cs @@ -0,0 +1,44 @@ +using Mono.Documentation.Updater; +using NUnit.Framework; + +namespace mdoc.Test +{ + [TestFixture] + public class DocUtilsFSharpTests : BasicFSharpFormatterTests<FSharpFormatter> + { + protected override FSharpFormatter formatter { get; } + + [Test] + public void IsIgnored_GetMethodIsGeneratedByProperty_IsIgnoredTrue() + { + var method = GetMethod(typeof(DiscriminatedUnions.Shape.Circle), + "get_" + nameof(DiscriminatedUnions.Shape.Circle.radius)); + + var isIgnoredPropertyGeneratedMethod = DocUtils.IsIgnored(method); + + Assert.IsTrue(isIgnoredPropertyGeneratedMethod); + } + + [Test] + public void IsIgnored_GetMethodIsGeneratedByProperty2_IsIgnoredTrue() + { + var method = GetMethod(typeof(DiscriminatedUnions.SizeUnion), + "get_" + nameof(DiscriminatedUnions.SizeUnion.Large)); + + var isIgnoredPropertyGeneratedMethod = DocUtils.IsIgnored(method); + + Assert.IsTrue(isIgnoredPropertyGeneratedMethod); + } + + [Test] + public void IsIgnored_GetMethodIsNotGeneratedByProperty_IsIgnoredFalse() + { + var method = GetMethod(typeof(Functions), + nameof(Functions.get_function)); + + var isIgnoredPropertyGeneratedMethod = DocUtils.IsIgnored(method); + + Assert.IsFalse(isIgnoredPropertyGeneratedMethod); + } + } +}
\ No newline at end of file |