Exemple #1
0
        public void TestFailureLogs()
        {
            LogEntry logEntry = new LogEntry()
            {
                Host            = TEST_HOST,
                Method          = TEST_METHOD,
                RequestHeaders  = TEST_REQUEST_METADATA,
                Request         = TEST_REQUEST,
                ResponseHeaders = TEST_RESPONSE_METADATA,
                Response        = TEST_RESPONSE,
                Exception       = TEST_EXCEPTION,
                IsFailure       = true,
                CustomerId      = TEST_CUSTOMER_ID
            };

            AssertExtensions.AreMultiLineEqual(TestResources.DetailedFailureLog,
                                               logEntry.DetailedLog);
            AssertExtensions.AreMultiLineEqual(TestResources.SummaryFailureLog,
                                               logEntry.SummaryLog);
        }
        public void TestSuccessStreamingLogs()
        {
            LogEntry logEntry = new LogEntry(logFormatter)
            {
                Host            = TEST_HOST,
                Method          = TEST_METHOD,
                RequestHeaders  = TEST_REQUEST_METADATA,
                Request         = TEST_STREAM_REQUEST,
                ResponseHeaders = TEST_STREAMING_RESPONSE_METADATA,
                Response        = TEST_STREAM_RESPONSE,
                Exception       = TEST_EXCEPTION,
                IsFailure       = false,
                CustomerId      = TEST_CUSTOMER_ID
            };

            AssertExtensions.AreMultiLineEqual(TestResources.DetailedStreamSuccessLog,
                                               logEntry.DetailedLog);
            AssertExtensions.AreMultiLineEqual(TestResources.SummaryStreamSuccessLog,
                                               logEntry.SummaryLog);
        }
        public void TestPartialFailureLogs()
        {
            LogEntry logEntry = new LogEntry(logFormatter)
            {
                Host            = TEST_HOST,
                Method          = TEST_METHOD,
                RequestHeaders  = TEST_REQUEST_METADATA,
                Request         = TEST_REQUEST,
                ResponseHeaders = TEST_RESPONSE_METADATA,
                Response        = TEST_RESPONSE,
                Exception       = TEST_EXCEPTION,
                IsFailure       = false,
                CustomerId      = TEST_CUSTOMER_ID,
                PartialFailures = TEST_PARTIAL_FAILURES
            };

            AssertExtensions.AreMultiLineEqual(TestResources.DetailedPartialFailureLog,
                                               logEntry.DetailedLog);
            AssertExtensions.AreMultiLineEqual(TestResources.SummarySuccessLog,
                                               logEntry.SummaryLog);
        }