Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(720)

Side by Side Diff: third_party/protobuf/csharp/src/Google.Protobuf.Test/WellKnownTypes/FieldMaskTest.cs

Issue 2495533002: third_party/protobuf: Update to HEAD (83d681ee2c) (Closed)
Patch Set: Make chrome settings proto generated file a component Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 #region Copyright notice and license 1 #region Copyright notice and license
2 // Protocol Buffers - Google's data interchange format 2 // Protocol Buffers - Google's data interchange format
3 // Copyright 2016 Google Inc. All rights reserved. 3 // Copyright 2016 Google Inc. All rights reserved.
4 // https://developers.google.com/protocol-buffers/ 4 // https://developers.google.com/protocol-buffers/
5 // 5 //
6 // Redistribution and use in source and binary forms, with or without 6 // Redistribution and use in source and binary forms, with or without
7 // modification, are permitted provided that the following conditions are 7 // modification, are permitted provided that the following conditions are
8 // met: 8 // met:
9 // 9 //
10 // * Redistributions of source code must retain the above copyright 10 // * Redistributions of source code must retain the above copyright
(...skipping 28 matching lines...) Expand all
39 { 39 {
40 [Test] 40 [Test]
41 [TestCase("foo__bar")] 41 [TestCase("foo__bar")]
42 [TestCase("foo_3_ar")] 42 [TestCase("foo_3_ar")]
43 [TestCase("fooBar")] 43 [TestCase("fooBar")]
44 public void ToString_Invalid(string input) 44 public void ToString_Invalid(string input)
45 { 45 {
46 var mask = new FieldMask { Paths = { input } }; 46 var mask = new FieldMask { Paths = { input } };
47 var text = mask.ToString(); 47 var text = mask.ToString();
48 // More specific test below 48 // More specific test below
49 Assert.That(text, Is.StringContaining("@warning")); 49 Assert.That(text, Does.Contain("@warning"));
50 Assert.That(text, Is.StringContaining(input)); 50 Assert.That(text, Does.Contain(input));
51 } 51 }
52 52
53 [Test] 53 [Test]
54 public void ToString_Invalid_Precise() 54 public void ToString_Invalid_Precise()
55 { 55 {
56 var mask = new FieldMask { Paths = { "x", "foo__bar", @"x\y" } }; 56 var mask = new FieldMask { Paths = { "x", "foo__bar", @"x\y" } };
57 Assert.AreEqual( 57 Assert.AreEqual(
58 "{ \"@warning\": \"Invalid FieldMask\", \"paths\": [ \"x\", \"fo o__bar\", \"x\\\\y\" ] }", 58 "{ \"@warning\": \"Invalid FieldMask\", \"paths\": [ \"x\", \"fo o__bar\", \"x\\\\y\" ] }",
59 mask.ToString()); 59 mask.ToString());
60 } 60 }
61 } 61 }
62 } 62 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698