< Summary

Class:Azure.Core.TestFramework.SyncAsyncTestBase
Assembly:Azure.Core.TestFramework
File(s):C:\Git\azure-sdk-for-net\sdk\core\Azure.Core.TestFramework\src\SyncAsyncTestBase.cs
Covered lines:16
Uncovered lines:1
Coverable lines:17
Total lines:47
Line coverage:94.1% (16 of 17)
Covered branches:0
Total branches:0

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
get_IsAsync()-100%100%
.ctor(...)-100%100%
CreateMockTransport()-100%100%
CreateMockTransport(...)-100%100%
CreateMockTransport(...)-100%100%
WrapStream(...)-0%100%

File(s)

C:\Git\azure-sdk-for-net\sdk\core\Azure.Core.TestFramework\src\SyncAsyncTestBase.cs

#LineLine coverage
 1// Copyright (c) Microsoft Corporation. All rights reserved.
 2// Licensed under the MIT License.
 3
 4using System;
 5using System.IO;
 6
 7namespace Azure.Core.TestFramework
 8{
 9    public class SyncAsyncTestBase
 10    {
 184811        public bool IsAsync { get; }
 12
 4013        public SyncAsyncTestBase(bool isAsync)
 14        {
 4015            IsAsync = isAsync;
 4016        }
 17
 18        protected MockTransport CreateMockTransport()
 19        {
 10420            return new MockTransport()
 10421            {
 10422                ExpectSyncPipeline = !IsAsync
 10423            };
 24        }
 25
 26        protected MockTransport CreateMockTransport(Func<MockRequest, MockResponse> responseFactory)
 27        {
 3628            return new MockTransport(responseFactory)
 3629            {
 3630                ExpectSyncPipeline = !IsAsync
 3631            };
 32        }
 33
 34        protected MockTransport CreateMockTransport(params MockResponse[] responses)
 35        {
 18236            return new MockTransport(responses)
 18237            {
 18238                ExpectSyncPipeline = !IsAsync
 18239            };
 40        }
 41
 42        protected Stream WrapStream(Stream stream)
 43        {
 044            return new AsyncValidatingStream(IsAsync, stream);
 45        }
 46    }
 47}