public void GetGcpConsoleLogsUrl_Organization()
        {
            GoogleLogger logger = GetLogger(logTarget: LogTarget.ForOrganization("12345"));
            string       query  = logger.GetGcpConsoleLogsUrl().Query;

            Assert.Contains("organizationId=12345", query);
            Assert.DoesNotContain("project=", query);
        }
示例#2
0
        public void OrganizationId()
        {
            string    organizationId = "oid";
            LogTarget logTarget      = LogTarget.ForOrganization(organizationId);

            Assert.Equal(LogTargetKind.Organization, logTarget.Kind);
            Assert.Equal(organizationId, logTarget.OrganizationId);
            Assert.Null(logTarget.ProjectId);
        }
示例#3
0
        public void GetFullLogName_Organization()
        {
            string    organizationId   = "oid";
            string    name             = "name";
            LogTarget logTarget        = LogTarget.ForOrganization(organizationId);
            string    organizationName = logTarget.GetFullLogName(name);

            Assert.Contains(name, organizationName);
            Assert.Contains(organizationId, organizationName);
        }
        public void ForLogTarget()
        {
            var logTarget   = LogTarget.ForOrganization(_organizationId);
            var eventTarget = EventTarget.ForLogTarget(logTarget);

            Assert.Equal(EventTargetKind.Logging, eventTarget.Kind);
            Assert.Same(logTarget, eventTarget.LogTarget);

#pragma warning disable CS0618 // Type or member is obsolete
            Assert.Null(eventTarget.LoggingClient);
            Assert.Null(eventTarget.LogName);
            Assert.Null(eventTarget.MonitoredResource);
#pragma warning restore CS0618 // Type or member is obsolete
        }
示例#5
0
        public void Logging_LogTarget()
        {
            var logTarget         = LogTarget.ForOrganization(_organizationId);
            var logName           = "another-log";
            var monitoredResource = new MonitoredResource {
                Type = "not_global"
            };
            var eventTarget = EventTarget.ForLogging(logTarget, logName, _loggingClient, monitoredResource);

            Assert.Equal(EventTargetKind.Logging, eventTarget.Kind);
            Assert.Equal(_loggingClient, eventTarget.LoggingClient);
            Assert.Equal(logTarget, eventTarget.LogTarget);
            Assert.Equal(logName, eventTarget.LogName);
            Assert.Equal(monitoredResource, eventTarget.MonitoredResource);
        }