示例#1
0
        public async Task BuildAsync_Should_Call_Constructor_On_Actor_Thread()
        {
            var              current = Thread.CurrentThread;
            DummyClass       target  = null;
            IDummyInterface2 intface = await _Factory.BuildAsync <IDummyInterface2>(() => { target = new DummyClass(); return(target); });

            await intface.DoAsync();

            target.Done.Should().BeTrue();
            target.CallingConstructorThread.Should().NotBe(current);
            target.CallingConstructorThread.Should().Be(target.CallingThread);
        }