< Summary

Class:Azure.Core.TestFramework.TestCollectionExtensions
Assembly:Azure.Core.TestFramework
File(s):C:\Git\azure-sdk-for-net\sdk\core\Azure.Core.TestFramework\src\TestCollectionExtensions.cs
Covered lines:5
Uncovered lines:1
Coverable lines:6
Total lines:25
Line coverage:83.3% (5 of 6)
Covered branches:3
Total branches:4
Branch coverage:75% (3 of 4)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
InitializeFrom(...)-83.33%75%

File(s)

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

#LineLine coverage
 1// Copyright (c) Microsoft Corporation. All rights reserved.
 2// Licensed under the MIT License.
 3
 4using System;
 5using System.Collections.Generic;
 6
 7namespace Azure.Core.TestFramework
 8{
 9    public static class TestCollectionExtensions
 10    {
 11        public static void InitializeFrom<T>(this ICollection<T> target, IEnumerable<T> source)
 12        {
 4013            if (source == null)
 14            {
 015                return;
 16            }
 17
 4018            target.Clear();
 32019            foreach (var s in source)
 20            {
 12021                target.Add(s);
 22            }
 4023        }
 24    }
 25}

Methods/Properties

InitializeFrom(...)