OLD | NEW |
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 Loading... |
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, Does.Contain("@warning")); | 49 Assert.That(text, Is.StringContaining("@warning")); |
50 Assert.That(text, Does.Contain(input)); | 50 Assert.That(text, Is.StringContaining(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 } |
OLD | NEW |