-
Notifications
You must be signed in to change notification settings - Fork 246
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2024 from microsoft/feat/result-deconstruct
feat: adds deconstructor to read result
- Loading branch information
Showing
3 changed files
with
30 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
using Xunit; | ||
using Microsoft.OpenApi.Reader; | ||
using Microsoft.OpenApi.Models; | ||
|
||
namespace Microsoft.OpenApi.Tests.Reader; | ||
|
||
public class ReadResultTests | ||
{ | ||
[Fact] | ||
public void Deconstructs() | ||
{ | ||
var readResult = new ReadResult() | ||
{ | ||
Document = new OpenApiDocument(), | ||
Diagnostic = new OpenApiDiagnostic() | ||
}; | ||
var (document, diagnostic) = readResult; | ||
Assert.Equal(readResult.Document, document); | ||
Assert.Equal(readResult.Diagnostic, diagnostic); | ||
} | ||
} |