<NME> postgeneration.patch
<BEF> ADDFILE
<MSG> Workaround for unit test generation issues

The strings generated by the unit test generator aren't valid resource names - because the generator doesn't know they should be. They're validated locally when determining a resource-based routing header, so the normal unit tests fail. This patch just fixes them up.

<DFF> @@ -0,0 +1,194 @@
+--- a/apis/Google.Cloud.Firestore.V1/Google.Cloud.Firestore.V1.Tests/FirestoreClientTest.g.cs
++++ b/apis/Google.Cloud.Firestore.V1/Google.Cloud.Firestore.V1.Tests/FirestoreClientTest.g.cs
+@@ -25,6 +25,11 @@ using xunit = Xunit;
+ 
+ namespace Google.Cloud.Firestore.V1.Tests
+ {
++    // Note: many of these unit tests contain strings of the form "projects/test/databases/test/documents/{random part}".
++    // These are currently created from a patch file, as the "just a random string" generated by the client generator
++    // fails the resource-based routing added in FirestoreClientPartial.cs.
++    // Once resource name annotations are added into the Firestore protos, the patch can be removed.
++
+     /// <summary>Generated unit tests.</summary>
+     public sealed class GeneratedFirestoreClientTest
+     {
+@@ -34,7 +39,7 @@ namespace Google.Cloud.Firestore.V1.Tests
+             moq::Mock<Firestore.FirestoreClient> mockGrpcClient = new moq::Mock<Firestore.FirestoreClient>(moq::MockBehavior.Strict);
+             GetDocumentRequest request = new GetDocumentRequest
+             {
+-                Name = "name1c9368b0",
++                Name = "projects/test/databases/test/documents/name1c9368b0",
+                 Mask = new DocumentMask(),
+                 Transaction = proto::ByteString.CopyFromUtf8("transaction6ab7d5f4"),
+                 ReadTime = new wkt::Timestamp(),
+@@ -65,7 +70,7 @@ namespace Google.Cloud.Firestore.V1.Tests
+             moq::Mock<Firestore.FirestoreClient> mockGrpcClient = new moq::Mock<Firestore.FirestoreClient>(moq::MockBehavior.Strict);
+             GetDocumentRequest request = new GetDocumentRequest
+             {
+-                Name = "name1c9368b0",
++                Name = "projects/test/databases/test/documents/name1c9368b0",
+                 Mask = new DocumentMask(),
+                 Transaction = proto::ByteString.CopyFromUtf8("transaction6ab7d5f4"),
+                 ReadTime = new wkt::Timestamp(),
+@@ -98,7 +103,7 @@ namespace Google.Cloud.Firestore.V1.Tests
+             moq::Mock<Firestore.FirestoreClient> mockGrpcClient = new moq::Mock<Firestore.FirestoreClient>(moq::MockBehavior.Strict);
+             CreateDocumentRequest request = new CreateDocumentRequest
+             {
+-                Parent = "parent7858e4d0",
++                Parent = "projects/test/databases/test/documents/parent7858e4d0",
+                 CollectionId = "collection_idd84d1a0a",
+                 DocumentId = "document_id10fcfae7",
+                 Document = new Document(),
+@@ -130,7 +135,7 @@ namespace Google.Cloud.Firestore.V1.Tests
+             moq::Mock<Firestore.FirestoreClient> mockGrpcClient = new moq::Mock<Firestore.FirestoreClient>(moq::MockBehavior.Strict);
+             CreateDocumentRequest request = new CreateDocumentRequest
+             {
+-                Parent = "parent7858e4d0",
++                Parent = "projects/test/databases/test/documents/parent7858e4d0",
+                 CollectionId = "collection_idd84d1a0a",
+                 DocumentId = "document_id10fcfae7",
+                 Document = new Document(),
+@@ -288,7 +293,7 @@ namespace Google.Cloud.Firestore.V1.Tests
+             moq::Mock<Firestore.FirestoreClient> mockGrpcClient = new moq::Mock<Firestore.FirestoreClient>(moq::MockBehavior.Strict);
+             DeleteDocumentRequest request = new DeleteDocumentRequest
+             {
+-                Name = "name1c9368b0",
++                Name = "projects/test/databases/test/documents/name1c9368b0",
+                 CurrentDocument = new Precondition(),
+             };
+             wkt::Empty expectedResponse = new wkt::Empty { };
+@@ -304,7 +309,7 @@ namespace Google.Cloud.Firestore.V1.Tests
+             moq::Mock<Firestore.FirestoreClient> mockGrpcClient = new moq::Mock<Firestore.FirestoreClient>(moq::MockBehavior.Strict);
+             DeleteDocumentRequest request = new DeleteDocumentRequest
+             {
+-                Name = "name1c9368b0",
++                Name = "projects/test/databases/test/documents/name1c9368b0",
+                 CurrentDocument = new Precondition(),
+             };
+             wkt::Empty expectedResponse = new wkt::Empty { };
+@@ -321,7 +326,7 @@ namespace Google.Cloud.Firestore.V1.Tests
+             moq::Mock<Firestore.FirestoreClient> mockGrpcClient = new moq::Mock<Firestore.FirestoreClient>(moq::MockBehavior.Strict);
+             DeleteDocumentRequest request = new DeleteDocumentRequest
+             {
+-                Name = "name1c9368b0",
++                Name = "projects/test/databases/test/documents/name1c9368b0",
+             };
+             wkt::Empty expectedResponse = new wkt::Empty { };
+             mockGrpcClient.Setup(x => x.DeleteDocument(request, moq::It.IsAny<grpccore::CallOptions>())).Returns(expectedResponse);
+@@ -336,7 +341,7 @@ namespace Google.Cloud.Firestore.V1.Tests
+             moq::Mock<Firestore.FirestoreClient> mockGrpcClient = new moq::Mock<Firestore.FirestoreClient>(moq::MockBehavior.Strict);
+             DeleteDocumentRequest request = new DeleteDocumentRequest
+             {
+-                Name = "name1c9368b0",
++                Name = "projects/test/databases/test/documents/name1c9368b0",
+             };
+             wkt::Empty expectedResponse = new wkt::Empty { };
+             mockGrpcClient.Setup(x => x.DeleteDocumentAsync(request, moq::It.IsAny<grpccore::CallOptions>())).Returns(new grpccore::AsyncUnaryCall<wkt::Empty>(stt::Task.FromResult(expectedResponse), null, null, null, null));
+@@ -352,7 +357,7 @@ namespace Google.Cloud.Firestore.V1.Tests
+             moq::Mock<Firestore.FirestoreClient> mockGrpcClient = new moq::Mock<Firestore.FirestoreClient>(moq::MockBehavior.Strict);
+             BeginTransactionRequest request = new BeginTransactionRequest
+             {
+-                Database = "databased8eee011",
++                Database = "projects/test/databases/databased8eee011",
+                 Options = new TransactionOptions(),
+             };
+             BeginTransactionResponse expectedResponse = new BeginTransactionResponse
+@@ -372,7 +377,7 @@ namespace Google.Cloud.Firestore.V1.Tests
+             moq::Mock<Firestore.FirestoreClient> mockGrpcClient = new moq::Mock<Firestore.FirestoreClient>(moq::MockBehavior.Strict);
+             BeginTransactionRequest request = new BeginTransactionRequest
+             {
+-                Database = "databased8eee011",
++                Database = "projects/test/databases/databased8eee011",
+                 Options = new TransactionOptions(),
+             };
+             BeginTransactionResponse expectedResponse = new BeginTransactionResponse
+@@ -394,7 +399,7 @@ namespace Google.Cloud.Firestore.V1.Tests
+             moq::Mock<Firestore.FirestoreClient> mockGrpcClient = new moq::Mock<Firestore.FirestoreClient>(moq::MockBehavior.Strict);
+             BeginTransactionRequest request = new BeginTransactionRequest
+             {
+-                Database = "databased8eee011",
++                Database = "projects/test/databases/databased8eee011",
+             };
+             BeginTransactionResponse expectedResponse = new BeginTransactionResponse
+             {
+@@ -413,7 +418,7 @@ namespace Google.Cloud.Firestore.V1.Tests
+             moq::Mock<Firestore.FirestoreClient> mockGrpcClient = new moq::Mock<Firestore.FirestoreClient>(moq::MockBehavior.Strict);
+             BeginTransactionRequest request = new BeginTransactionRequest
+             {
+-                Database = "databased8eee011",
++                Database = "projects/test/databases/databased8eee011",
+             };
+             BeginTransactionResponse expectedResponse = new BeginTransactionResponse
+             {
+@@ -434,7 +439,7 @@ namespace Google.Cloud.Firestore.V1.Tests
+             moq::Mock<Firestore.FirestoreClient> mockGrpcClient = new moq::Mock<Firestore.FirestoreClient>(moq::MockBehavior.Strict);
+             CommitRequest request = new CommitRequest
+             {
+-                Database = "databased8eee011",
++                Database = "projects/test/databases/databased8eee011",
+                 Writes = { new Write(), },
+                 Transaction = proto::ByteString.CopyFromUtf8("transaction6ab7d5f4"),
+             };
+@@ -456,7 +461,7 @@ namespace Google.Cloud.Firestore.V1.Tests
+             moq::Mock<Firestore.FirestoreClient> mockGrpcClient = new moq::Mock<Firestore.FirestoreClient>(moq::MockBehavior.Strict);
+             CommitRequest request = new CommitRequest
+             {
+-                Database = "databased8eee011",
++                Database = "projects/test/databases/databased8eee011",
+                 Writes = { new Write(), },
+                 Transaction = proto::ByteString.CopyFromUtf8("transaction6ab7d5f4"),
+             };
+@@ -480,7 +485,7 @@ namespace Google.Cloud.Firestore.V1.Tests
+             moq::Mock<Firestore.FirestoreClient> mockGrpcClient = new moq::Mock<Firestore.FirestoreClient>(moq::MockBehavior.Strict);
+             CommitRequest request = new CommitRequest
+             {
+-                Database = "databased8eee011",
++                Database = "projects/test/databases/databased8eee011",
+                 Writes = { new Write(), },
+             };
+             CommitResponse expectedResponse = new CommitResponse
+@@ -501,7 +506,7 @@ namespace Google.Cloud.Firestore.V1.Tests
+             moq::Mock<Firestore.FirestoreClient> mockGrpcClient = new moq::Mock<Firestore.FirestoreClient>(moq::MockBehavior.Strict);
+             CommitRequest request = new CommitRequest
+             {
+-                Database = "databased8eee011",
++                Database = "projects/test/databases/databased8eee011",
+                 Writes = { new Write(), },
+             };
+             CommitResponse expectedResponse = new CommitResponse
+@@ -524,7 +529,7 @@ namespace Google.Cloud.Firestore.V1.Tests
+             moq::Mock<Firestore.FirestoreClient> mockGrpcClient = new moq::Mock<Firestore.FirestoreClient>(moq::MockBehavior.Strict);
+             RollbackRequest request = new RollbackRequest
+             {
+-                Database = "databased8eee011",
++                Database = "projects/test/databases/databased8eee011",
+                 Transaction = proto::ByteString.CopyFromUtf8("transaction6ab7d5f4"),
+             };
+             wkt::Empty expectedResponse = new wkt::Empty { };
+@@ -540,7 +545,7 @@ namespace Google.Cloud.Firestore.V1.Tests
+             moq::Mock<Firestore.FirestoreClient> mockGrpcClient = new moq::Mock<Firestore.FirestoreClient>(moq::MockBehavior.Strict);
+             RollbackRequest request = new RollbackRequest
+             {
+-                Database = "databased8eee011",
++                Database = "projects/test/databases/databased8eee011",
+                 Transaction = proto::ByteString.CopyFromUtf8("transaction6ab7d5f4"),
+             };
+             wkt::Empty expectedResponse = new wkt::Empty { };
+@@ -557,7 +562,7 @@ namespace Google.Cloud.Firestore.V1.Tests
+             moq::Mock<Firestore.FirestoreClient> mockGrpcClient = new moq::Mock<Firestore.FirestoreClient>(moq::MockBehavior.Strict);
+             RollbackRequest request = new RollbackRequest
+             {
+-                Database = "databased8eee011",
++                Database = "projects/test/databases/databased8eee011",
+                 Transaction = proto::ByteString.CopyFromUtf8("transaction6ab7d5f4"),
+             };
+             wkt::Empty expectedResponse = new wkt::Empty { };
+@@ -573,7 +578,7 @@ namespace Google.Cloud.Firestore.V1.Tests
+             moq::Mock<Firestore.FirestoreClient> mockGrpcClient = new moq::Mock<Firestore.FirestoreClient>(moq::MockBehavior.Strict);
+             RollbackRequest request = new RollbackRequest
+             {
+-                Database = "databased8eee011",
++                Database = "projects/test/databases/databased8eee011",
+                 Transaction = proto::ByteString.CopyFromUtf8("transaction6ab7d5f4"),
+             };
+             wkt::Empty expectedResponse = new wkt::Empty { };

{'addition_count': 194, 'commit_subject': 'Workaround for unit test generation issues', 'deletion_count': 0, 'file_extension': '.patch', 'lang': 'Cloud', 'license': 'apache-2.0', 'repo_name': 'googleapis/google-cloud-dotnet'}