Mono.Cecil.Tests.PortablePdbTests.StateMachineCustomDebugInformation C# (CSharp) Method

StateMachineCustomDebugInformation() private method

private StateMachineCustomDebugInformation ( ) : void
return void
        public void StateMachineCustomDebugInformation()
        {
            TestPortablePdbModule (module => {
                var state_machine = module.GetType ("PdbTarget.Program/<Baz>d__7");
                var move_next = state_machine.GetMethod ("MoveNext");

                Assert.IsTrue (move_next.HasCustomDebugInformations);
                Assert.AreEqual (2, move_next.CustomDebugInformations.Count);

                var state_machine_scope = move_next.CustomDebugInformations [0] as StateMachineScopeDebugInformation;
                Assert.IsNotNull (state_machine_scope);
                Assert.AreEqual (0, state_machine_scope.Start.Offset);
                Assert.IsTrue (state_machine_scope.End.IsEndOfMethod);

                var async_body = move_next.CustomDebugInformations [1] as AsyncMethodBodyDebugInformation;
                Assert.IsNotNull (async_body);
                Assert.AreEqual (-1, async_body.CatchHandler.Offset);

                Assert.AreEqual (2, async_body.Yields.Count);
                Assert.AreEqual (61, async_body.Yields [0].Offset);
                Assert.AreEqual (221, async_body.Yields [1].Offset);

                Assert.AreEqual (2, async_body.Resumes.Count);
                Assert.AreEqual (91, async_body.Resumes [0].Offset);
                Assert.AreEqual (252, async_body.Resumes [1].Offset);

                Assert.AreEqual (move_next, async_body.MoveNextMethod);
            });
        }