-
Notifications
You must be signed in to change notification settings - Fork 4.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Initial implementation of the RsaCryptographicProvider (#7724)
Resolves #7662
- Loading branch information
Showing
48 changed files
with
11,469 additions
and
143 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
// Copyright (c) Microsoft Corporation. All rights reserved. | ||
// Licensed under the MIT License. | ||
|
||
using System; | ||
using Azure.Core.Testing; | ||
using NUnit.Framework; | ||
|
||
namespace Azure.Core.Tests | ||
{ | ||
public class FieldsAttributeTests | ||
{ | ||
[Test] | ||
public void DiscoversFields([Fields]Data data) | ||
{ | ||
Assert.That(data, Is.AnyOf(Data.Data1, Data.Data2)); | ||
} | ||
|
||
[Test] | ||
public void IncludesNamedFields([Fields(nameof(Data.Data1), nameof(Data.InternalData))]Data data) | ||
{ | ||
Assert.AreEqual(Data.Data1, data); | ||
} | ||
|
||
[Test] | ||
public void ExcludesNamedFields([Fields(Exclude = new[] { nameof(Data.Data2) })]Data data) | ||
{ | ||
Assert.AreEqual(Data.Data1, data); | ||
} | ||
|
||
[Test] | ||
public void ExcludesNamedFieldsOverride([Fields(nameof(Data.Data1), nameof(Data.Data2), Exclude = new[] { nameof(Data.Data2) })]Data data) | ||
{ | ||
Assert.AreEqual(Data.Data1, data); | ||
} | ||
|
||
public readonly struct Data : IEquatable<Data> | ||
{ | ||
public static readonly Data Data1 = new Data(1); | ||
public static readonly Data Data2 = new Data(2); | ||
internal static readonly Data InternalData = new Data(3); | ||
private static readonly Data PrivateData = new Data(4); | ||
|
||
private readonly int _value; | ||
|
||
private Data(int value) | ||
{ | ||
_value = value; | ||
} | ||
|
||
public bool Equals(Data other) => _value == other._value; | ||
} | ||
} | ||
} |
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
Oops, something went wrong.