| Index: third_party/grpc/src/csharp/Grpc.Core.Tests/CallCredentialsTest.cs
|
| diff --git a/third_party/protobuf/csharp/src/Google.Protobuf.Test/DeprecatedMemberTest.cs b/third_party/grpc/src/csharp/Grpc.Core.Tests/CallCredentialsTest.cs
|
| similarity index 63%
|
| copy from third_party/protobuf/csharp/src/Google.Protobuf.Test/DeprecatedMemberTest.cs
|
| copy to third_party/grpc/src/csharp/Grpc.Core.Tests/CallCredentialsTest.cs
|
| index 8dfad8b331c1622d9325af438a1eaa6e1c5c25fd..82f881969ebf5496f976c3158d783bd9ae1aec73 100644
|
| --- a/third_party/protobuf/csharp/src/Google.Protobuf.Test/DeprecatedMemberTest.cs
|
| +++ b/third_party/grpc/src/csharp/Grpc.Core.Tests/CallCredentialsTest.cs
|
| @@ -1,7 +1,7 @@
|
| -#region Copyright notice and license
|
| -// Protocol Buffers - Google's data interchange format
|
| -// Copyright 2015 Google Inc. All rights reserved.
|
| -// https://developers.google.com/protocol-buffers/
|
| +#region Copyright notice and license
|
| +
|
| +// Copyright 2015, Google Inc.
|
| +// All rights reserved.
|
| //
|
| // Redistribution and use in source and binary forms, with or without
|
| // modification, are permitted provided that the following conditions are
|
| @@ -28,28 +28,38 @@
|
| // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
| // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
| // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
| +
|
| #endregion
|
| -
|
| +
|
| using System;
|
| -using System.Reflection;
|
| -using Google.Protobuf.TestProtos;
|
| +using System.Diagnostics;
|
| +using System.Runtime.InteropServices;
|
| +using System.Threading;
|
| +using System.Threading.Tasks;
|
| +using Grpc.Core;
|
| +using Grpc.Core.Internal;
|
| +using Grpc.Core.Utils;
|
| using NUnit.Framework;
|
|
|
| -namespace Google.Protobuf
|
| +namespace Grpc.Core.Tests
|
| {
|
| - public class DeprecatedMemberTest
|
| + public class CallCredentialsTest
|
| {
|
| - private static void AssertIsDeprecated(MemberInfo member)
|
| + [Test]
|
| + public void CallCredentials_ComposeAtLeastTwo()
|
| {
|
| - Assert.NotNull(member);
|
| - Assert.IsTrue(member.IsDefined(typeof(ObsoleteAttribute), false), "Member not obsolete: " + member);
|
| + Assert.Throws(typeof(ArgumentException), () => CallCredentials.Compose(new FakeCallCredentials()));
|
| }
|
|
|
| [Test]
|
| - public void TestDepreatedPrimitiveValue()
|
| + public void CallCredentials_ToNativeCredentials()
|
| {
|
| - AssertIsDeprecated(typeof(TestDeprecatedFields).GetProperty("DeprecatedInt32"));
|
| + var composite = CallCredentials.Compose(
|
| + CallCredentials.FromInterceptor(async (uri, m) => { await Task.Delay(1); }),
|
| + CallCredentials.FromInterceptor(async (uri, m) => { await Task.Delay(2); }));
|
| + using (var nativeComposite = composite.ToNativeCredentials())
|
| + {
|
| + }
|
| }
|
| -
|
| }
|
| }
|
|
|