diff options
author | Mikhail Melnikov <mikhail_melnikov@epam.com> | 2018-04-27 14:54:16 +0300 |
---|---|---|
committer | Joel Martinez <joelmartinez@gmail.com> | 2018-04-27 22:46:20 +0300 |
commit | 89ef92404a729c67671e0daaa274320b9053bbd5 (patch) | |
tree | 42900884837df1f940cf8f7aec7c829eac435b2c /mdoc/mdoc.Test/MDocUpdaterTests.cs | |
parent | 9d7610859c73d63bc4008e0de6595b9a72148a5b (diff) |
Special treatment of ref-like structs to not produce Obsolete attribute
Added a unit test for MDocUpdater.GetCustomAttributes
Added logic to skip the attribute `Obsolete`
Changed test classes hierarchy
Closes #225
Diffstat (limited to 'mdoc/mdoc.Test/MDocUpdaterTests.cs')
-rw-r--r-- | mdoc/mdoc.Test/MDocUpdaterTests.cs | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/mdoc/mdoc.Test/MDocUpdaterTests.cs b/mdoc/mdoc.Test/MDocUpdaterTests.cs new file mode 100644 index 00000000..9280943a --- /dev/null +++ b/mdoc/mdoc.Test/MDocUpdaterTests.cs @@ -0,0 +1,26 @@ +using System.Collections.Generic; +using Mono.Cecil; +using Mono.Collections.Generic; +using Mono.Documentation; +using NUnit.Framework; + +namespace mdoc.Test +{ + [TestFixture] + public class MDocUpdaterTests : BasicTests + { + readonly MDocUpdater updater = new MDocUpdater(); + + [Test] + public void Test_GetCustomAttributes_IgnoredObsoleteAttribute() + { + TypeDefinition testType = GetType(typeof(MDocUpdaterTests).Module.FullyQualifiedName, "System.Span`1"); + Collection<CustomAttribute> attributes = testType.CustomAttributes; + + IEnumerable<string> customAttributes = updater.GetCustomAttributes(attributes, ""); + + Assert.AreEqual(1, attributes.Count); + Assert.IsEmpty(customAttributes); + } + } +}
\ No newline at end of file |