Skip to content

Commit a42c40d

Browse files
Copilotadamsitnik
andcommitted
Apply ConditionalClass attribute and simplify MarkItDownReaderTests
- Remove blank line between System and other using directives - Add [ConditionalClass] attribute to MarkItDownReaderTests class - Simplify CreateDocumentReader method to directly return reader without conditional check - ConditionalClass handles test skipping at class level, eliminating need for manual condition checks Co-authored-by: adamsitnik <6011991+adamsitnik@users.noreply.github.com>
1 parent 2f71906 commit a42c40d

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

test/Libraries/Microsoft.Extensions.DataIngestion.Tests/Readers/MarkItDownReaderTests.cs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,16 @@
44
using System;
55
using System.Linq;
66
using System.Threading.Tasks;
7-
87
using Microsoft.DotNet.XUnitExtensions;
98
using Xunit;
109

1110
namespace Microsoft.Extensions.DataIngestion.Readers.Tests;
1211

12+
[ConditionalClass(typeof(MarkItDownCondition), nameof(MarkItDownCondition.IsMarkItDownInstalled))]
1313
public class MarkItDownReaderTests : DocumentReaderConformanceTests
1414
{
1515
protected override IngestionDocumentReader CreateDocumentReader(bool extractImages = false)
16-
=> MarkItDownCondition.IsInstalled.Value
17-
? new MarkItDownReader(extractImages: extractImages)
18-
: throw new SkipTestException("MarkItDown is not installed");
16+
=> new MarkItDownReader(extractImages: extractImages);
1917

2018
protected override void SimpleAsserts(IngestionDocument document, string source, string expectedId)
2119
{

0 commit comments

Comments
 (0)