< Summary

Information
Class: Test.Program
Assembly: Sample
File(s): C:\temp\Program.cs
Line coverage
100%
Covered lines: 15
Uncovered lines: 0
Coverable lines: 15
Total lines: 84
Line coverage: 100%
Branch coverage
N/A
Covered branches: 0
Total branches: 0
Branch coverage: N/A
Method coverage
100%
Covered methods: 3
Total methods: 3
Method coverage: 100%

Coverage history

0255075100

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity NPath complexity Sequence coverage
CallAsyncMethod()100%330100%
.ctor(...)100%110100%
SendAsync(...)100%110100%

File(s)

C:\temp\Program.cs

#LineLine coverage
 1using System.Net.Http;
 2using System.Threading;
 3using System.Threading.Tasks;
 4using Microsoft.VisualStudio.TestTools.UnitTesting;
 5
 6namespace Test
 7{
 8    [TestClass]
 9    public class Program
 10    {
 11        static void Main(string[] args)
 12        {
 13            new TestClass().SampleFunction();
 14
 15            new TestClass2("Test").ExecutedMethod();
 16            new TestClass2("Test").SampleFunction("Munich");
 17
 18            new PartialClass().ExecutedMethod_1();
 19            new PartialClass().ExecutedMethod_2();
 20            new PartialClass().SomeProperty = -10;
 21
 222            new PartialClassWithAutoProperties().Property1 = "Test";
 23            new PartialClassWithAutoProperties().Property2 = "Test";
 24
 25            new SomeClass().Property1 = "Test";
 26
 27            new ClassWithExcludes().IncludedMethod();
 28            new ClassWithExcludes().ExcludedMethod();
 29
 30            new GenericClass<SomeModel, IState>().Process(null);
 31            new GenericClass<SomeModel, IState>().PostProcess(null);
 32
 33            new CodeContract_Target().Calculate(-1);
 34
 35            new AbstractClass_SampleImpl1();
 36            new AbstractClass_SampleImpl2();
 37
 38            CallAsyncMethod();
 39
 40            try
 41            {
 42                new CodeContract_Target().Calculate(0);
 43            }
 44            catch (System.ArgumentException)
 45            {
 46            }
 47        }
 48
 49        [TestMethod]
 250        public void CSharp_ExecuteTest1()
 51        {
 52            Main(null);
 53        }
 54
 55        [TestMethod]
 56        public void CSharp_ExecuteTest2()
 57        {
 58            Main(null);
 59        }
 60
 61        private static async void CallAsyncMethod()
 162        {
 163            var expected = new HttpResponseMessage();
 164            var handler = new AsyncClass() { InnerHandler = new EchoHandler(expected) };
 165            var invoker = new HttpMessageInvoker(handler, false);
 166            var actual = await invoker.SendAsync(new HttpRequestMessage(), new CancellationToken());
 167        }
 68
 69        private class EchoHandler : DelegatingHandler
 70        {
 71            private HttpResponseMessage _response;
 72
 173            public EchoHandler(HttpResponseMessage response)
 174            {
 175                this._response = response;
 176            }
 77
 78            protected override Task<HttpResponseMessage> SendAsync(HttpRequestMessage request, CancellationToken cancell
 179            {
 180                return Task.FromResult(this._response);
 181            }
 82        }
 83    }
 84}