-
Notifications
You must be signed in to change notification settings - Fork 4.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[API Implementation]: Expose CookieException constructors (#109026)
* Expose CookieException constructors * Apply suggestions Co-Authored-By: Miha Zupan <miha.zupan@microsoft.com> * Fix tests --------- Co-authored-by: Miha Zupan <miha.zupan@microsoft.com> Co-authored-by: Miha Zupan <mihazupan.zupan1@gmail.com>
- Loading branch information
1 parent
5962bd7
commit 670401f
Showing
5 changed files
with
45 additions
and
4 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
28 changes: 28 additions & 0 deletions
28
src/libraries/System.Net.Primitives/tests/UnitTests/CookieExceptionTest.cs
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,28 @@ | ||
// Licensed to the .NET Foundation under one or more agreements. | ||
// The .NET Foundation licenses this file to you under the MIT license. | ||
|
||
using Xunit; | ||
|
||
namespace System.Net.Primitives.UnitTests.Tests; | ||
|
||
public sealed class CookieExceptionTest | ||
{ | ||
[Fact] | ||
public void Constructor_Message() | ||
{ | ||
var exception = new CookieException("Foo"); | ||
Assert.Equal("Foo", exception.Message); | ||
} | ||
|
||
[Theory] | ||
[InlineData(true)] | ||
[InlineData(false)] | ||
public void Constructor_Message_InnerException(bool innerException) | ||
{ | ||
var inner = innerException ? new Exception() : null; | ||
var exception = new CookieException("Foo", inner); | ||
|
||
Assert.Equal("Foo", exception.Message); | ||
Assert.Equal(inner, exception.InnerException); | ||
} | ||
} |
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