/// <summary> /// Fetches the database, creating it if necessary. /// </summary> /// <param name="projectId">The project ID to use, typically from a fixture.</param> public static SpannerTestDatabase GetInstance(string projectId) { lock (s_lock) { if (s_instance == null) { s_instance = new SpannerTestDatabase(projectId); } else if (s_instance.ProjectId != projectId) { throw new ArgumentException($"A database for project ID {s_instance.ProjectId} has already been created; this test requested {projectId}"); } return(s_instance); } }
public SpannerFixtureBase() { GrpcInfo.EnableSubchannelCounting(); Database = SpannerTestDatabase.GetInstance(ProjectId); }