| Index: third_party/protobuf/csharp/src/Google.Protobuf.Test/WellKnownTypes/FieldMaskTest.cs
|
| diff --git a/third_party/protobuf/csharp/src/Google.Protobuf.Test/DeprecatedMemberTest.cs b/third_party/protobuf/csharp/src/Google.Protobuf.Test/WellKnownTypes/FieldMaskTest.cs
|
| similarity index 67%
|
| copy from third_party/protobuf/csharp/src/Google.Protobuf.Test/DeprecatedMemberTest.cs
|
| copy to third_party/protobuf/csharp/src/Google.Protobuf.Test/WellKnownTypes/FieldMaskTest.cs
|
| index 8dfad8b331c1622d9325af438a1eaa6e1c5c25fd..89bc82759c59ea4151654dc7a4ba7d78cfc32313 100644
|
| --- a/third_party/protobuf/csharp/src/Google.Protobuf.Test/DeprecatedMemberTest.cs
|
| +++ b/third_party/protobuf/csharp/src/Google.Protobuf.Test/WellKnownTypes/FieldMaskTest.cs
|
| @@ -1,6 +1,6 @@
|
| #region Copyright notice and license
|
| // Protocol Buffers - Google's data interchange format
|
| -// Copyright 2015 Google Inc. All rights reserved.
|
| +// Copyright 2016 Google Inc. All rights reserved.
|
| // https://developers.google.com/protocol-buffers/
|
| //
|
| // Redistribution and use in source and binary forms, with or without
|
| @@ -29,27 +29,34 @@
|
| // (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 NUnit.Framework;
|
|
|
| -namespace Google.Protobuf
|
| +namespace Google.Protobuf.WellKnownTypes
|
| {
|
| - public class DeprecatedMemberTest
|
| + public class FieldMaskTest
|
| {
|
| - private static void AssertIsDeprecated(MemberInfo member)
|
| + [Test]
|
| + [TestCase("foo__bar")]
|
| + [TestCase("foo_3_ar")]
|
| + [TestCase("fooBar")]
|
| + public void ToString_Invalid(string input)
|
| {
|
| - Assert.NotNull(member);
|
| - Assert.IsTrue(member.IsDefined(typeof(ObsoleteAttribute), false), "Member not obsolete: " + member);
|
| + var mask = new FieldMask { Paths = { input } };
|
| + var text = mask.ToString();
|
| + // More specific test below
|
| + Assert.That(text, Is.StringContaining("@warning"));
|
| + Assert.That(text, Is.StringContaining(input));
|
| }
|
|
|
| [Test]
|
| - public void TestDepreatedPrimitiveValue()
|
| + public void ToString_Invalid_Precise()
|
| {
|
| - AssertIsDeprecated(typeof(TestDeprecatedFields).GetProperty("DeprecatedInt32"));
|
| + var mask = new FieldMask { Paths = { "x", "foo__bar", @"x\y" } };
|
| + Assert.AreEqual(
|
| + "{ \"@warning\": \"Invalid FieldMask\", \"paths\": [ \"x\", \"foo__bar\", \"x\\\\y\" ] }",
|
| + mask.ToString());
|
| }
|
| -
|
| }
|
| }
|
|
|