< Summary

Class:SeungYongShim.Akka.DependencyInjection.FakePropsFactory`1
Assembly:SeungYongShim.Akka.DependencyInjection.XUnit2
File(s):/home/runner/work/SeungYongShim.Akka/SeungYongShim.Akka/src/SeungYongShim.Akka.DependencyInjection.XUnit2/TestKit.cs
Covered lines:2
Uncovered lines:0
Coverable lines:2
Total lines:33
Line coverage:100% (2 of 2)
Covered branches:0
Total branches:0
Tag:81_945672945

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity NPath complexity Sequence coverage
.ctor(...)0%110100%
Create(...)0%110100%

File(s)

/home/runner/work/SeungYongShim.Akka/SeungYongShim.Akka/src/SeungYongShim.Akka.DependencyInjection.XUnit2/TestKit.cs

#LineLine coverage
 1using System;
 2using Akka.Actor;
 3using Akka.DependencyInjection;
 4using Microsoft.Extensions.DependencyInjection;
 5using SeungYongShim.Akka.DependencyInjection.Abstractions;
 6
 7namespace SeungYongShim.Akka.DependencyInjection
 8{
 9
 10    internal class FakePropsFactory<T> : IPropsFactory<T> where T : ActorBase
 11    {
 212        public FakePropsFactory(ActorSystem actorSystem) => ActorSystem = actorSystem;
 13
 14        public ActorSystem ActorSystem { get; }
 15
 16        public Props Create(params object[] args) =>
 117            DependencyResolver.For(ActorSystem).Props<FakeActor>(args);
 18    }
 19
 20    internal class FakeActor : ReceiveActor
 21    {
 22        public FakeActor(IServiceProvider sp) : this(sp, default) { }
 23        public FakeActor(IServiceProvider sp, object o1) : this(sp, o1, default) { }
 24        public FakeActor(IServiceProvider sp, object o1, object o2) : this(sp, o1, o2, default) { }
 25        public FakeActor(IServiceProvider sp, object o1, object o2, object o3) : this(sp, o1, o2, o3, default) { }
 26        public FakeActor(IServiceProvider sp, object o1, object o2, object o3, object o4) : this(sp, o1, o2, o3, o4, def
 27        private FakeActor(IServiceProvider sp, params object[] args)
 28        {
 29            var testActor = sp.GetService<GetTestActor>()();
 30            ReceiveAny(testActor.Forward);
 31        }
 32    }
 33}